#4570
Să se scrie un program care să determine numărul de cifre pare și numărul de cifre impare ale unui număr natural citit de la tastatură.
| Problema | NumarulDeCifre1 | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64556232 | Utilizator | |
| Fișier | numaruldecifre1.cpp | Dimensiune | 1.37 KB |
| Data încărcării | 14 Mai 2026, 10:03 | Scor/rezultat | Eroare de compilare |
numaruldecifre1.cpp: In function ‘int main()’: numaruldecifre1.cpp:16:5: warning: this ‘else’ clause does not guard... [-Wmisleading-indentation] 16 | else | ^~~~ numaruldecifre1.cpp:18:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘else’ 18 | n=n/10; | ^ numaruldecifre1.cpp: At global scope: numaruldecifre1.cpp:26:5: error: redefinition of ‘int main()’ 26 | int main() | ^~~~ numaruldecifre1.cpp:5:5: note: ‘int main()’ previously defined here 5 | int main() | ^~~~ numaruldecifre1.cpp: In function ‘int main()’: numaruldecifre1.cpp:37:5: warning: this ‘else’ clause does not guard... [-Wmisleading-indentation] 37 | else | ^~~~ numaruldecifre1.cpp:39:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘else’ 39 | n=n/10; | ^ numaruldecifre1.cpp: At global scope: numaruldecifre1.cpp:47:5: error: redefinition of ‘int main()’ 47 | int main() | ^~~~ numaruldecifre1.cpp:5:5: note: ‘int main()’ previously defined here 5 | int main() | ^~~~ numaruldecifre1.cpp: In function ‘int main()’: numaruldecifre1.cpp:58:5: warning: this ‘else’ clause does not guard... [-Wmisleading-indentation] 58 | else | ^~~~ numaruldecifre1.cpp:60:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘else’ 60 | n=n/10; | ^ numaruldecifre1.cpp: At global scope: numaruldecifre1.cpp:68:5: error: redefinition of ‘int main()’ 68 | int main() | ^~~~ numaruldecifre1.cpp:5:5: note: ‘int main()’ previously defined here 5 | int main() | ^~~~ numaruldecifre1.cpp: In function ‘int main()’: numaruldecifre1.cpp:79:5: warning: this ‘else’ clause does not guard... [-Wmisleading-indentation] 79 | else | ^~~~ numaruldecifre1.cpp:81:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘else’ 81 | n=n/10; | ^ numaruldecifre1.cpp: At global scope: numaruldecifre1.cpp:89:5: error: redefinition of ‘int main()’ 89 | int main() | ^~~~ numaruldecifre1.cpp:5:5: note: ‘int main()’ previously defined here 5 | int main() | ^~~~ numaruldecifre1.cpp: In function ‘int main()’: numaruldecifre1.cpp:100:5: warning: this ‘else’ clause does not guard... [-Wmisleading-indentation] 100 | else | ^~~~ numaruldecifre1.cpp:102:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘else’ 102 | n=n/10; | ^ numaruldecifre1.cpp: At global scope: numaruldecifre1.cpp:110:5: error: redefinition of ‘int main()’ 110 | int main() | ^~~~ numaruldecifre1.cpp:5:5: note: ‘int main()’ previously defined here 5 | int main() | ^~~~ numaruldecifre1.cpp: In function ‘int main()’: numaruldecifre1.cpp:121:5: warning: this ‘else’ clause does not guard... [-Wmisleading-indentation] 121 | else | ^~~~ numaruldecifre1.cpp:123:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘else’ 123 | n=n/10; | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema NumarulDeCifre1 face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:
Suma punctajelor acordate pe testele utilizate pentru verificare este 100. Astfel, soluția ta poate obține cel mult 100 de puncte, caz în care se poate considera corectă.