Advertisement
ahmad_zizo

Untitled

Jan 30th, 2014
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <math.h>
  4. int main()
  5. {
  6. int a,b,n,i=0;
  7. float c;
  8. scanf("%d",&n);
  9. for(a=1; a<n; a++)
  10. for(b=a; b<n; b++)
  11. {
  12. c=sqrt(a*a*1.0 + b*b*1.0);
  13. if(c<=n && c-(int)c==0)
  14. i++;
  15. }
  16. printf("%d",i);
  17. return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement