#525
Se dau n numere naturale. Determinaţi cele mai mari două numere cu trei cifre care nu apar printre numerele date.
| Problema | Numere1 | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64502205 | Utilizator | |
| Fișier | numere1.cpp | Dimensiune | 431 B |
| Data încărcării | 11 Mai 2026, 14:45 | Scor/rezultat | Eroare de compilare |
numere1.cpp:4:22: error: ‘int select [2]’ redeclared as different kind of entity 4 | int v[1000], select[2]; | ^ In file included from /usr/include/x86_64-linux-gnu/sys/types.h:179, from /usr/include/stdlib.h:514, from /usr/include/c++/13/cstdlib:79, from /usr/include/c++/13/ext/string_conversions.h:43, from /usr/include/c++/13/bits/basic_string.h:4109, from /usr/include/c++/13/string:54, from /usr/include/c++/13/bits/locale_classes.h:40, from /usr/include/c++/13/bits/ios_base.h:41, from /usr/include/c++/13/ios:44, from /usr/include/c++/13/ostream:40, from /usr/include/c++/13/iostream:41, from numere1.cpp:1: /usr/include/x86_64-linux-gnu/sys/select.h:102:12: note: previous declaration ‘int select(int, fd_set*, fd_set*, fd_set*, timeval*)’ 102 | extern int select (int __nfds, fd_set *__restrict __readfds, | ^~~~~~ numere1.cpp: In function ‘int main()’: numere1.cpp:18:23: warning: pointer to a function used in arithmetic [-Wpointer-arith] 18 | select[cnt]=i; | ^ numere1.cpp:18:24: error: assignment of read-only location ‘*(select + ((sizetype)cnt))’ 18 | select[cnt]=i; | ~~~~~~~~~~~^~ numere1.cpp:21:23: warning: pointer to a function used in arithmetic [-Wpointer-arith] 21 | cout<<select[2]<<' '<<select[1]; | ^ numere1.cpp:21:23: warning: comparing the result of pointer addition ‘(select + 2)’ and NULL [-Waddress] numere1.cpp:21:39: warning: pointer to a function used in arithmetic [-Wpointer-arith] 21 | cout<<select[2]<<' '<<select[1]; | ^ numere1.cpp:21:39: warning: comparing the result of pointer addition ‘(select + 1)’ and NULL [-Waddress]
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Numere1 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ă.