#249
Se dă un număr natural X şi un şir cu n numere naturale distincte două câte două. Să se determine poziţia pe care s-ar afla numărul X în şirul sortat.
| Problema | PozitieX | Operații I/O |
pozitiex.in/pozitiex.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64390199 | Utilizator | |
| Fișier | pozitiex.cpp | Dimensiune | 521 B |
| Data încărcării | 04 Mai 2026, 20:41 | Scor/rezultat | Eroare de compilare |
pozitiex.cpp: In function ‘int main()’: pozitiex.cpp:10:17: error: ‘x’ was not declared in this scope 10 | fin >> n >> x; | ^ pozitiex.cpp:11:5: error: ‘nr’ was not declared in this scope; did you mean ‘n’? 11 | nr=0; | ^~ | n pozitiex.cpp:12:5: error: ‘exsita’ was not declared in this scope; did you mean ‘exit’? 12 | exsita=false; | ^~~~~~ | exit pozitiex.cpp:14:9: error: ‘i’ was not declared in this scope 14 | for(i=0; i<n ; i++) | ^ pozitiex.cpp:19:13: error: ‘exista’ was not declared in this scope; did you mean ‘exit’? 19 | exista=true; | ^~~~~~ | exit pozitiex.cpp:26:9: error: ‘exista’ was not declared in this scope; did you mean ‘exit’? 26 | if(!exista) | ^~~~~~ | exit
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema PozitieX 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ă.