Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<math.h>
- int main()
- {
- int x[3], n, i, j;
- scanf("%d", &n);
- double y[n], temp, p, q, r;
- for(i=0; i<n; i++)
- {
- for(j=0; j<3; j++)
- {
- scanf("%d", &x[j]);
- }
- y[i]= sqrt(pow(x[0],2) + pow(x[1], 2) + pow(x[2], 2));
- }
- for (i = 0; i<n; i++)
- {
- for (j = i+1; j<n; j++)
- {
- if (y[i] > y[j])
- {
- temp = y[i];
- y[i] = y[j];
- y[j] = temp;
- }
- }
- }
- p = pow(y[0], 2);
- q = pow(y[1], 2);
- r = pow(y[2], 2);
- if((p+q)==r)
- {
- printf("YES\n");
- }
- else
- {
- printf("NO\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement