fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int a,b,c,i=0;
  5. for(a=1;a<100;a++){
  6.  
  7. for(b=1;b<a;b++){
  8.  
  9. for(c=5;c<100;c++){
  10.  
  11. if(a*a+b*b==c*c){
  12.  
  13. printf("(%d,%d,%d)",a,b,c);
  14. i++;
  15. }
  16. }
  17. }
  18. }
  19. printf("\n%d組",i);
  20. return 0;
  21. }
  22.  
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
(4,3,5)(8,6,10)(12,5,13)(12,9,15)(15,8,17)(16,12,20)(20,15,25)(21,20,29)(24,7,25)(24,10,26)(24,18,30)(28,21,35)(30,16,34)(32,24,40)(35,12,37)(36,15,39)(36,27,45)(40,9,41)(40,30,50)(42,40,58)(44,33,55)(45,24,51)(45,28,53)(48,14,50)(48,20,52)(48,36,60)(52,39,65)(55,48,73)(56,33,65)(56,42,70)(60,11,61)(60,25,65)(60,32,68)(60,45,75)(63,16,65)(63,60,87)(64,48,80)(68,51,85)(70,24,74)(72,21,75)(72,30,78)(72,54,90)(72,65,97)(75,40,85)(76,57,95)(77,36,85)(80,18,82)(80,39,89)(84,13,85)(84,35,91)
50組