Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <math.h>
- int main()
- {
- int a,b,n,i=0;
- float c;
- scanf("%d",&n);
- for(a=1; a<n; a++)
- for(b=a; b<n; b++)
- {
- c=sqrt(a*a*1.0 + b*b*1.0);
- if(c<=n && c-(int)c==0)
- i++;
- }
- printf("%d",i);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement