#167
Să se scrie un program care citeşte de la tastatură un număr întreg şi determină semnul său.
| Problema | Semn | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64404043 | Utilizator | |
| Fișier | semn.cpp | Dimensiune | 214 B |
| Data încărcării | 05 Mai 2026, 12:41 | Scor/rezultat | Eroare de compilare |
semn.cpp:1:2: error: invalid preprocessing directive #i; did you mean #if? 1 | #i#include <iostream> | ^ | if semn.cpp: In function ‘int main()’: semn.cpp:7:5: error: ‘cin’ was not declared in this scope 7 | cin>>n; | ^~~ semn.cpp:1:1: note: ‘std::cin’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’? +++ |+#include <iostream> 1 | #i#include <iostream> semn.cpp:9:9: error: ‘cout’ was not declared in this scope 9 | cout<<"pozitiv"; | ^~~~ semn.cpp:9:9: note: ‘std::cout’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’? semn.cpp:11:9: error: ‘cout’ was not declared in this scope 11 | cout <<"negativ"; | ^~~~ semn.cpp:11:9: note: ‘std::cout’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’? semn.cpp:13:9: error: ‘cout’ was not declared in this scope 13 | cout<<nul; | ^~~~ semn.cpp:13:9: note: ‘std::cout’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’? semn.cpp:13:15: error: ‘nul’ was not declared in this scope 13 | cout<<nul; | ^~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Semn 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ă.