Home > Back-end >  Input number three, if to check number of shares then return 1, it returns 0
Input number three, if to check number of shares then return 1, it returns 0

Time:10-04

Int Max (int a, b int, int) c {
Int maxmax=0;
If (a> b> C | | a> C> B) {
Maxmax=a;
} else if (b> a> C | | b> C> A) {
Maxmax=b;
} else if (c> b> A | | c> a> B) {
Maxmax=c;
}
Return maxmax;
}
Int tangle (int a, b int, int) c {
Int t;
T=Max (a, b, c);
If (t * t==a * a * b * b | | a * a + c * c | | b * b * c + c) {
return 1;
} else {
return 0;
}
}
Int main (int arg c, const char * argv []) {
Int a, b, c;
The scanf (" % d % d % d ", & amp; A, & amp; B, & amp; C);
Printf (" % d \ n ", tangle (a, b, c));
return 0;
}
Where I went wrong

CodePudding user response:

If (t * t==a * a * b * b | | t==a * a + c * * t c | | t * t==b + c * b * c)

You know

CodePudding user response:

 # include & lt; stdio.h> 

Int Max (int a, b int, int) c {
Int maxmax=0;
# if 0
If (a> b> C | | a> C> B) {
If (a> b> C | | a> C> B) {
Maxmax=a;
} else if (b> a> C | | b> C> A) {
Maxmax=b;
} else if (c> b> A | | c> a> B) {
Maxmax=c;
}
# endif
If (a & gt; B)
Maxmax=a;
The else
Maxmax=b;

If (maxmax & lt; C)
Maxmax=c;

Return maxmax;
}
Int tangle (int a, b int, int) c {
Int t;
T=Max (a, b, c);
If ((t * t==a * a * b * b) | | (t * t==a * a * c + c) | | (t * t==b + c * b * c)) {
return 1;
} else {
return 0;
}
}

Int main (int arg c, const char * argv [])
{
Int a, b, c;
The scanf (" % d % d % d ", & amp; A, & amp; B, & amp; C);
Printf (" % d \ n ", tangle (a, b, c));
return 0;
}

For your reference ~

A. & gt; B & gt; This is not a c language programming c syntax
  • Related