#include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> /* run this program using the console pauser or add your own getch, system("pause") or input loop */ int main() { int a,b,i,j,k; scanf("%d,%d",&a,&b); for(i=a;i<=b;i++){ for(j=i+1;j<b;j++){ for(k=j+1;k<=b;k++){ if(i*i+j*j==k*k){ printf("%d^2+%d^2=%d^2\n",i,j,k); } } } } } |
Double click to view unformatted code.