#509
Să se scrie un program care ordonează crescător elementele unui vector.
| Problema | Ordonare | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64076147 | Utilizator | |
| Fișier | ordonare.cpp | Dimensiune | 411 B |
| Data încărcării | 15 Aprilie 2026, 19:11 | Scor/rezultat | Eroare de compilare |
ordonare.cpp:1:2: error: stray ‘#’ in program 1 | v#include <iostream> | ^ ordonare.cpp:1:1: error: ‘v’ does not name a type 1 | v#include <iostream> | ^ In file included from /usr/include/c++/13/cmath:45, from ordonare.cpp:2: /usr/include/c++/13/ext/type_traits.h:164:35: error: ‘constexpr const bool __gnu_cxx::__is_null_pointer’ redeclared as different kind of entity 164 | __is_null_pointer(std::nullptr_t) | ^ /usr/include/c++/13/ext/type_traits.h:159:5: note: previous declaration ‘template<class _Type> constexpr bool __gnu_cxx::__is_null_pointer(_Type)’ 159 | __is_null_pointer(_Type) | ^~~~~~~~~~~~~~~~~ /usr/include/c++/13/ext/type_traits.h:164:26: error: ‘nullptr_t’ is not a member of ‘std’ 164 | __is_null_pointer(std::nullptr_t) | ^~~~~~~~~ ordonare.cpp: In function ‘int main()’: ordonare.cpp:8:5: error: ‘cin’ was not declared in this scope 8 | cin>>n; | ^~~ ordonare.cpp:3:1: note: ‘std::cin’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’? 2 | #include <cmath> +++ |+#include <iostream> 3 | using namespace std; ordonare.cpp:22:9: error: ‘cout’ was not declared in this scope 22 | cout<<v[i]<<" "; | ^~~~ ordonare.cpp:22:9: note: ‘std::cout’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’?
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Ordonare 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ă.