#4861
Se citește de la tastatură un număr natural n de 3 cifre. Să se verifice dacă numărul citit este un palindrom.
| Problema | pal3 | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #59649315 | Utilizator | |
| Fișier | pal3.cpp | Dimensiune | 244 B |
| Data încărcării | 06 Octombrie 2025, 09:48 | Scor/rezultat | Eroare de compilare |
pal3.cpp: In function 'int main()': pal3.cpp:5:7: error: expected initializer before '<=' token int x <= 9; y <= 9; z <= 9; ^ pal3.cpp:5:13: error: 'y' was not declared in this scope int x <= 9; y <= 9; z <= 9; ^ pal3.cpp:5:21: error: 'z' was not declared in this scope int x <= 9; y <= 9; z <= 9; ^ pal3.cpp:6:5: error: 'x' was not declared in this scope n = x * 10 * 10 + y * 10 + z * 1; ^ pal3.cpp:8:12: warning: comparisons like 'X<=Y<=Z' do not have their mathematical meaning [-Wparentheses] if (100<=n<=999 ; x = z) { ^ pal3.cpp:8:21: error: expected ')' before ';' token if (100<=n<=999 ; x = z) { ^ pal3.cpp:8:28: error: expected ';' before ')' token if (100<=n<=999 ; x = z) { ^ pal3.cpp:10:5: error: 'else' without a previous 'if' else { ^ pal3.cpp:12:9: error: expected '}' at end of input return 0; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema pal3 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ă.