#3926
alternant1
Spunem că un număr natural este alternant dacă cifrele pare alternează cu cele impare. De exemplu, numere alternante sunt 236
, 6
, 12345678
. Se dă un număr natural n
. Să se verifice dacă este sau nu alternant.
Problema | alternant1 | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #34041394 | Utilizator | |
Fișier | alternant1.cpp | Dimensiune | 1.49 KB |
Data încărcării | 19 Ianuarie 2022, 11:32 | Scor / rezultat | 70 puncte |
alternant1.cpp: In function 'int main()': alternant1.cpp:28:11: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if(c=1) ^ alternant1.cpp:33:12: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if(c=10) ^ alternant1.cpp:38:13: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if(c=101) ^ alternant1.cpp:43:14: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if(c=1010) ^ alternant1.cpp:48:15: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if(c=10101) ^ alternant1.cpp:53:16: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if(c=101010) ^ alternant1.cpp:58:17: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if(c=1010101) ^ alternant1.cpp:63:18: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if(c=10101010) ^ alternant1.cpp:68:19: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if(c=101010101) ^ alternant1.cpp:73:20: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if(c=1010101010) ^ alternant1.cpp:78:9: warning: overflow in implicit constant conversion [-Woverflow] if(c=10101010101) ^ alternant1.cpp:78:21: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if(c=10101010101) ^ alternant1.cpp:83:9: warning: overflow in implicit constant conversion [-Woverflow] if(c=101010101010) ^ alternant1.cpp:83:22: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if(c=101010101010) ^ alternant1.cpp:88:9: warning: overflow in implicit constant conversion [-Woverflow] if(c=1010101010101) ^ alternant1.cpp:88:23: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if(c=1010101010101) ^ alternant1.cpp:93:9: warning: overflow in implicit constant conversion [-Woverflow] if(c=10101010101010) ^ alternant1.cpp:93:24: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if(c=10101010101010) ^ alternant1.cpp:98:9: warning: overflow in implicit constant conversion [-Woverflow] if(c=101010101010101) ^ alternant1.cpp:98:25: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if(c=101010101010101) ^
Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
---|---|---|---|---|---|---|
1 | 0 secunde | Raspuns gresit. | 10 | 0 | ||
2 | 0 secunde | OK. | 10 | 10 | ||
3 | 0 secunde | OK. | 10 | 10 | ||
4 | 0 secunde | OK. | 10 | 10 | ||
5 | 0 secunde | OK. | 10 | 10 | ||
6 | 0 secunde | OK. | 10 | 10 | ||
7 | 0 secunde | Raspuns gresit. | 10 | 0 | ||
8 | 0 secunde | OK. | 10 | 10 | ||
9 | 0 secunde | OK. | 10 | 10 | ||
10 | 0 secunde | Raspuns gresit. | 10 | 0 | ||
Punctaj total | 70 |
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema alternant1 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ă.