#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 | #34041253 | Utilizator | |
Fișier | alternant1.cpp | Dimensiune | 1.43 KB |
Data încărcării | 19 Ianuarie 2022, 11:27 | Scor / rezultat | 70 puncte |
alternant1.cpp: In function 'int main()': alternant1.cpp:24:11: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if(c=1) ^ alternant1.cpp:29:12: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if(c=10) ^ alternant1.cpp:34:13: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if(c=101) ^ alternant1.cpp:39:14: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if(c=1010) ^ alternant1.cpp:44:15: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if(c=10101) ^ alternant1.cpp:49:16: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if(c=101010) ^ alternant1.cpp:54:17: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if(c=1010101) ^ alternant1.cpp:59:18: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if(c=10101010) ^ alternant1.cpp:64:19: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if(c=101010101) ^ alternant1.cpp:69:20: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if(c=1010101010) ^ alternant1.cpp:74:9: warning: overflow in implicit constant conversion [-Woverflow] if(c=10101010101) ^ alternant1.cpp:74:21: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if(c=10101010101) ^ alternant1.cpp:79:9: warning: overflow in implicit constant conversion [-Woverflow] if(c=101010101010) ^ alternant1.cpp:79:22: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if(c=101010101010) ^ alternant1.cpp:84:9: warning: overflow in implicit constant conversion [-Woverflow] if(c=1010101010101) ^ alternant1.cpp:84:23: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if(c=1010101010101) ^ alternant1.cpp:89:9: warning: overflow in implicit constant conversion [-Woverflow] if(c=10101010101010) ^ alternant1.cpp:89:24: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if(c=10101010101010) ^ alternant1.cpp:94:9: warning: overflow in implicit constant conversion [-Woverflow] if(c=101010101010101) ^ alternant1.cpp:94: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ă.