Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <math.h>
- #define TRUE 1
- #define FALSE 0
- int pitagoras(int a, int b, int c)
- {
- int x,y;
- x=pow(a,2)+pow(b,2);
- y=c*c;
- if(y==x)
- return TRUE;
- return FALSE;
- }
- int main()
- {
- int a,b,c;
- int x,check=FALSE,soma=0;
- for(a=3;a<500;a++)
- for(b=4;b<500;b++)
- for(c=5;c<500;c++)
- {
- x=pitagoras(a,b,c);
- if(x==1)
- {
- soma=(a+b+c);
- if(soma==1000)
- {
- printf("Soma: %d \ta: %d \tb: %d \tc: %d \ta.b.c = %d",soma,a,b,c,(a*b*c));
- return TRUE;
- }
- else if(soma>1000)
- break;
- }
- }
- return TRUE;
- }
- c
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement