Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int estePatratPerfect(int nr) {
- // implementezi tu
- }
- int main() {
- int nrPatrate = 0;
- int nrCititAnterior = 0, nrCititCurent = 0;
- do {
- nrCititAnterior = nrCititCurent;
- scanf("%i", &nrCititCurent); // citesc numarul
- printf("\n"); // (optional) linie noua
- if (estePatratPerfect(nrCititCurent) == 1) {
- nrPatrate++;
- }
- }
- while (nrCititCurent != (nrCititAnterior + 1));
- printf("%d", nrPatrate);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement