#1311
Se citește de la tastatură un număr natural de 3 cifre. Să se stabilească dacă are toate cifrele egale.
| Problema | CifEgale | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64955789 | Utilizator | |
| Fișier | cifegale.cpp | Dimensiune | 222 B |
| Data încărcării | 23 Iunie 2026, 17:57 | Scor/rezultat | Eroare de compilare |
cifegale.cpp: In function ‘int main()’: cifegale.cpp:7:6: error: ‘c1’ was not declared in this scope; did you mean ‘c’? 7 | c1=n%10; | ^~ | c cifegale.cpp:6:2: warning: this ‘while’ clause does not guard... [-Wmisleading-indentation] 6 | while(n!=0) | ^~~~~ cifegale.cpp:8:6: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘while’ 8 | c2=n%100; | ^~ cifegale.cpp:8:6: error: ‘c2’ was not declared in this scope; did you mean ‘c’? 8 | c2=n%100; | ^~ | c cifegale.cpp:9:6: error: ‘c3’ was not declared in this scope; did you mean ‘c’? 9 | c3=n%1000; | ^~ | c cifegale.cpp:10:5: error: ‘c1’ was not declared in this scope; did you mean ‘c’? 10 | if(c1==c2==c3) | ^~ | c cifegale.cpp:4:8: warning: unused variable ‘c’ [-Wunused-variable] 4 | {int n,c; | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema CifEgale 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ă.