Home > Back-end >  New source code, please help to check the wrong
New source code, please help to check the wrong

Time:12-14

# include "stdio.h"
Int hj (int, int);
Int tf (int * *, int, int).
Int main ()
{
int a;
The scanf (" % d ", & amp; A);
[a], [2], int z=0 b, c, d, e;
While (b{
/the scanf (" % d % d ", & amp; Z [b] [0], & amp; Z [b] [1]);
//printf (" % d % d \ n ", [b] [0], z z [b] [1]).
B++;
}
C=z [0] [1].
For (c=1; C{
If (cC=z [c] [1];
}
D=tf (z, c, b);//reduction to common denomiator and return the final molecular
Hj (d, c);

}
Int (tf)
{
Int d, e, f=0;
For (d=0; D{
E=c/a, [d] [1].
A [d] [1]=c;
A [d] [0]=[d] a [0] * e;
F +=a, [d] [0].
}
Return the f;
}
Int hj (int * * a, int b, int c)
{
Int e;

For (e=a; E>=2; E -)
{
If (a % e==0 & amp; & B % e==0)
{
A=c/e;
B=d/e;
break;
}
}
Return a, b

}

CodePudding user response:

Return a, b
C is not allowed to return to two parameters, can pass the pointer, changes the value of the parameter
  • Related