#816
Determinați câte sticle de x litri cu apă trebuie deschise pentru a umple un vas de y litri.
| Problema | Sticle | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64111507 | Utilizator | |
| Fișier | sticle.cpp | Dimensiune | 205 B |
| Data încărcării | 17 Aprilie 2026, 14:35 | Scor/rezultat | Eroare de compilare |
sticle.cpp:3:5: error: extended character is not valid in an identifier 3 | using namespace std; | ^ sticle.cpp:3:5: error: extended character is not valid in an identifier sticle.cpp:5:7: error: extended character is not valid in an identifier 5 | int main() | ^ sticle.cpp:7:1: error: extended character is not valid in an identifier 7 | int x,y,n; | ^ sticle.cpp:7:1: error: extended character is not valid in an identifier sticle.cpp:7:1: error: extended character is not valid in an identifier sticle.cpp:7:1: error: extended character is not valid in an identifier sticle.cpp:9:13: error: extended character is not valid in an identifier 9 | if(y%xI>0) | ^ sticle.cpp:11:2: error: extended character is not valid in an identifier 11 | else | ^ sticle.cpp:3:5: error: ‘using namespace std’ does not name a type 3 | using namespace std; | ^~~~~~~~~~~~~~~~~~~ sticle.cpp:5:7: error: ISO C++ forbids declaration of ‘int main’ with no type [-fpermissive] 5 | int main() | ^~~~~~~~ sticle.cpp: In function ‘int int main()’: sticle.cpp:7:1: error: ‘ int’ was not declared in this scope 7 | int x,y,n; | ^~~~~~~ sticle.cpp:8:5: error: ‘cin’ was not declared in this scope; did you mean ‘std::cin’? 8 | cin>>x>>y; | ^~~ | std::cin In file included from sticle.cpp:1: /usr/include/c++/13/iostream:62:18: note: ‘std::cin’ declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ sticle.cpp:8:10: error: ‘x’ was not declared in this scope 8 | cin>>x>>y; | ^ sticle.cpp:8:13: error: ‘y’ was not declared in this scope 8 | cin>>x>>y; | ^ sticle.cpp:9:8: error: ‘xI’ was not declared in this scope 9 | if(y%xI>0) | ^~ sticle.cpp:9:13: error: ‘ ’ was not declared in this scope 9 | if(y%xI>0) | ^ sticle.cpp:13:6: error: ‘cout’ was not declared in this scope; did you mean ‘std::cout’? 13 | cout<< n>> endl; | ^~~~ | std::cout /usr/include/c++/13/iostream:63:18: note: ‘std::cout’ declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ sticle.cpp:13:13: error: ‘n’ was not declared in this scope 13 | cout<< n>> endl; | ^ sticle.cpp:13:17: error: ‘endl’ was not declared in this scope; did you mean ‘std::endl’? 13 | cout<< n>> endl; | ^~~~ | std::endl In file included from /usr/include/c++/13/iostream:41: /usr/include/c++/13/ostream:735:5: note: ‘std::endl’ declared here 735 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Sticle 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ă.