#55
Se citesc numere de la tastatură până la apariția lui zero. Să se determine minimul celor pozitive.
| Problema | MinimPozitive | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64344169 | Utilizator | |
| Fișier | minimpozitive.cpp | Dimensiune | 230 B |
| Data încărcării | 30 Aprilie 2026, 17:07 | Scor/rezultat | Eroare de compilare |
minimpozitive.cpp: In function ‘int main()’: minimpozitive.cpp:5:19: error: expected initializer before ‘>’ token 5 | int x,MIN>1000000; | ^ minimpozitive.cpp:7:10: warning: this ‘while’ clause does not guard... [-Wmisleading-indentation] 7 | while (x!=0); | ^~~~~ minimpozitive.cpp:8:10: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘while’ 8 | {if (x>0) && MIN>x); | ^ minimpozitive.cpp:8:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 8 | {if (x>0) && MIN>x); | ~~~~~~^~ minimpozitive.cpp:8:28: error: expected ‘;’ before ‘)’ token 8 | {if (x>0) && MIN>x); | ^ | ; minimpozitive.cpp:8:26: warning: statement has no effect [-Wunused-value] 8 | {if (x>0) && MIN>x); | ~~~~~~^~ minimpozitive.cpp:9:10: error: ‘MIN’ was not declared in this scope 9 | MIN=x; | ^~~ minimpozitive.cpp:12:13: error: ‘MIN’ was not declared in this scope 12 | if(MIN==1000000) cout<<"NU EXISTA"; | ^~~ minimpozitive.cpp:8:23: error: label ‘MIN’ used but not defined 8 | {if (x>0) && MIN>x); | ^~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema MinimPozitive 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ă.