杭电acm1017题 感觉代码没错,但就是ac不了,我无解了,题目是这样的:Given two integers n and m,count the number of pairs of integers (a,b) such that 0 < a < b < n and (a^2+b^2 +m)/(ab) is an integer.This problem contains multiple

来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/24 23:10:45
杭电acm1017题感觉代码没错,但就是ac不了,我无解了,题目是这样的:Giventwointegersnandm,countthenumberofpairsofintegers(a,b)sucht

杭电acm1017题 感觉代码没错,但就是ac不了,我无解了,题目是这样的:Given two integers n and m,count the number of pairs of integers (a,b) such that 0 < a < b < n and (a^2+b^2 +m)/(ab) is an integer.This problem contains multiple
杭电acm1017题 感觉代码没错,但就是ac不了,我无解了,
题目是这样的:Given two integers n and m,count the number of pairs of integers (a,b) such that 0 < a < b < n and (a^2+b^2 +m)/(ab) is an integer.
This problem contains multiple test cases!
The first line of a multiple input is an integer N,then a blank line followed by N input blocks.Each input block is in the format indicated in the problem description.There is a blank line between input blocks.
The output format consists of N output blocks.There is a blank line between output blocks.
InputYou will be given a number of cases in the input.Each case is specified by a line containing the integers n and m.The end of input is indicated by a case in which n = m = 0.You may assume that 0 < n

杭电acm1017题 感觉代码没错,但就是ac不了,我无解了,题目是这样的:Given two integers n and m,count the number of pairs of integers (a,b) such that 0 < a < b < n and (a^2+b^2 +m)/(ab) is an integer.This problem contains multiple
/*不知道你为什么觉得你的代码没有问题,连测试样例都没过.
题目中是第一行输入有几组测试数据,这个组不是case,而是每个0 0标志一组结束
下面是根据你代码修改AC后的结果,
*/
#include
int main()
{
\x05int n,m,i,j,x,a,z=0,c;
\x05scanf("%d",&x);
\x05for(a=1;a1) printf("\n");
\x05\x05c = 0;
\x05\x05while(++c)
\x05\x05{
\x05\x05\x05scanf("%d %d",&n,&m);
\x05\x05\x05if(!((n==m)&&(n==0)))
\x05\x05\x05{
\x05\x05\x05\x05z=0;
\x05\x05\x05\x05for(i=1;i