Meseriasul

Problema 12

Nov 26th, 2014
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.45 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. void main(){
  4.     int i,j,n;
  5.     int l1 = 0, l2 = 0, l3 = 0;
  6.     int contor = 1;
  7.  
  8.     printf("n = "); scanf("%d", &n);
  9.     do{
  10.         l1 = contor;
  11.         for(i = 1; i < n; i++){
  12.             l2 = i;
  13.             for(j = 1; j < n; j++){
  14.                 l3 = j;
  15.                 if(l1*l1+l2*l2 == l3*l3)
  16.                     printf("(%d,%d,%d) \n", l1,l2,l3);
  17.             }
  18.         }
  19.         contor++;
  20.     }while(contor < n);
  21. }
Advertisement
Add Comment
Please, Sign In to add comment