Advertisement
Guest User

Untitled

a guest
Jan 18th, 2017
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.52 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int estePatratPerfect(int nr) {
  4.     // implementezi tu
  5. }
  6.  
  7. int main() {
  8.     int nrPatrate = 0;
  9.     int nrCititAnterior = 0, nrCititCurent = 0;
  10.  
  11.     do {
  12.         nrCititAnterior = nrCititCurent;
  13.         scanf("%i", &nrCititCurent); // citesc numarul
  14.         printf("\n"); // (optional) linie noua
  15.  
  16.         if (estePatratPerfect(nrCititCurent) == 1) {
  17.             nrPatrate++;
  18.         }
  19.     }
  20.     while (nrCititCurent != (nrCititAnterior + 1));
  21.  
  22.     printf("%d", nrPatrate);
  23.  
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement