#2708
Se citesc n numere naturale. Determinați pentru fiecare dintre ele dacă este par sau impar.
| Problema | VerifParitate | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #49980899 | Utilizator | |
| Fișier | verifparitate.cpp | Dimensiune | 373 B |
| Data încărcării | 21 Martie 2024, 22:41 | Scor/rezultat | 20 puncte |
verifparitate.cpp: In function 'int main()': verifparitate.cpp:6:16: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'long unsigned int*' [-Wformat=] scanf("%d", &n); ^ verifparitate.cpp:7:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int i = 0; i < n; i++) ^ verifparitate.cpp:9:20: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'long unsigned int*' [-Wformat=] scanf("%d", &x[i]); ^ verifparitate.cpp:10:21: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses] if (1 & (x[i]>>0) == 0) ^ verifparitate.cpp:15:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int i = 0; i < n; i++) ^ verifparitate.cpp:5:27: warning: variable 'p' set but not used [-Wunused-but-set-variable] unsigned long n, x[1001],p[1001]; ^ verifparitate.cpp:6:17: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] scanf("%d", &n); ^ verifparitate.cpp:9:21: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] scanf("%d", &x[i]); ^
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0 secunde | OK. | 20 | 20 | Exemplu | |
| 2 | 0 secunde | Raspuns gresit. | 20 | 0 | ||
| 3 | 0 secunde | Raspuns gresit. | 20 | 0 | ||
| 4 | 0 secunde | Raspuns gresit. | 20 | 0 | ||
| 5 | 0 secunde | Raspuns gresit. | 20 | 0 | ||
| Punctaj total | 20 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema VerifParitate 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ă.