#3053
EvenOddXXL
Se dă un număr natural n
. Să se determine paritatea lui. Dacă numărul este par se afișează Par
, altfel se afișează Impar
.
Problema | EvenOddXXL | Operații I/O |
evenoddxxl.in /evenoddxxl.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #53502405 | Utilizator | |
Fișier | evenoddxxl.cpp | Dimensiune | 385 B |
Data încărcării | 03 Noiembrie 2024, 13:10 | Scor / rezultat | Eroare de compilare |
evenoddxxl.cpp: In function 'int main()': evenoddxxl.cpp:5:2: error: 'ifstream' was not declared in this scope ifstream fin ("evenoddxxl.in"); ^ evenoddxxl.cpp:5:2: note: suggested alternative: In file included from /usr/include/c++/4.8/ios:38:0, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from evenoddxxl.cpp:1: /usr/include/c++/4.8/iosfwd:157:34: note: 'std::ifstream' typedef basic_ifstream<char> ifstream; ^ evenoddxxl.cpp:5:11: error: expected ';' before 'fin' ifstream fin ("evenoddxxl.in"); ^ evenoddxxl.cpp:6:4: error: 'ofstream' was not declared in this scope ofstream fout ("evenoddxxl.out"); ^ evenoddxxl.cpp:6:4: note: suggested alternative: In file included from /usr/include/c++/4.8/ios:38:0, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from evenoddxxl.cpp:1: /usr/include/c++/4.8/iosfwd:160:34: note: 'std::ofstream' typedef basic_ofstream<char> ofstream; ^ evenoddxxl.cpp:6:13: error: expected ';' before 'fout' ofstream fout ("evenoddxxl.out"); ^ evenoddxxl.cpp:9:5: error: 'fin' was not declared in this scope fin>>nr; ^ evenoddxxl.cpp:10:25: error: expected ']' before '}' token cifu=nr[strlen(nr)-1}-'0'; ^ evenoddxxl.cpp:10:25: error: expected ';' before '}' token evenoddxxl.cpp: At global scope: evenoddxxl.cpp:10:26: error: expected unqualified-id before '-' token cifu=nr[strlen(nr)-1}-'0'; ^ evenoddxxl.cpp:11:13: error: expected unqualified-id before 'if' if (cifu%2==1) ^ evenoddxxl.cpp:13:13: error: expected unqualified-id before 'else' else ^ evenoddxxl.cpp:16:4: error: 'fin' does not name a type fin.close(); ^ evenoddxxl.cpp:17:4: error: 'fout' does not name a type fout.close(); ^ evenoddxxl.cpp:18:4: error: expected unqualified-id before 'return' return 0; ^ evenoddxxl.cpp:19:1: error: expected declaration before '}' token } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema EvenOddXXL 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ă.