#1625
Se citesc de la tastatura 3 valori reale a, b , c. Rezolvați ecuația de gradul doi cu a*x2+b*x+c=0
| Problema | ec2 | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64773151 | Utilizator | |
| Fișier | ec2.cpp | Dimensiune | 386 B |
| Data încărcării | 29 Mai 2026, 10:50 | Scor/rezultat | Eroare de compilare |
ec2.cpp: In function ‘int main()’: ec2.cpp:13:38: error: no match for ‘operator=’ (operand types are ‘std::basic_ostream<char>’ and ‘double’) 13 | cout << x1 = (-b + sqrt(s)) / 2; | ^ In file included from /usr/include/c++/13/iostream:41, from ec2.cpp:1: /usr/include/c++/13/ostream:449:7: note: candidate: ‘std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator=(std::basic_ostream<_CharT, _Traits>&&) [with _CharT = char; _Traits = std::char_traits<char>]’ 449 | operator=(basic_ostream&& __rhs) | ^~~~~~~~ /usr/include/c++/13/ostream:449:33: note: no known conversion for argument 1 from ‘double’ to ‘std::basic_ostream<char>&&’ 449 | operator=(basic_ostream&& __rhs) | ~~~~~~~~~~~~~~~~^~~~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema ec2 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ă.