#3551
InaltimeTriunghi
După ce s-a terminat școala, Gigel s-a apucat de rezolvat probleme de informatică și a găsit următoarea:
Fie un triunghi dreptunghic. Știindu-se lungimile laturilor triunghiului, să se determine lungimea înălţimii dusă din unghiul drept pe ipotenuză.
matematică
Problema | InaltimeTriunghi | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #55179060 | Utilizator | |
Fișier | inaltimetriunghi.cpp | Dimensiune | 207 B |
Data încărcării | 03 Ianuarie 2025, 22:37 | Scor / rezultat | Eroare de compilare |
inaltimetriunghi.cpp:5:1: error: stray '\357' in program float x; ^ inaltimetriunghi.cpp:5:1: error: stray '\274' in program inaltimetriunghi.cpp:5:1: error: stray '\233' in program inaltimetriunghi.cpp:7:1: error: stray '\321' in program cin>>с1>>c2>>i; ^ inaltimetriunghi.cpp:7:1: error: stray '\201' in program inaltimetriunghi.cpp:10:1: error: stray '\357' in program cout<<b<<" "<<c; ^ inaltimetriunghi.cpp:10:1: error: stray '\274' in program inaltimetriunghi.cpp:10:1: error: stray '\233' in program inaltimetriunghi.cpp:11:1: error: stray '\302' in program return 0; ^ inaltimetriunghi.cpp:11:1: error: stray '\240' in program inaltimetriunghi.cpp: In function 'int main()': inaltimetriunghi.cpp:6:1: error: expected initializer before 'int' int c1,c2,i; ^ inaltimetriunghi.cpp:7:4: error: ambiguous overload for 'operator>>' (operand types are 'std::istream {aka std::basic_istream<char>}' and 'int') cin>>с1>>c2>>i; ^ inaltimetriunghi.cpp:7:4: note: candidates are: In file included from /usr/include/c++/4.8/iostream:40:0, from inaltimetriunghi.cpp:1: /usr/include/c++/4.8/istream:120:7: note: std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::basic_istream<_CharT, _Traits>::__istream_type& (*)(std::basic_istream<_CharT, _Traits>::__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__istream_type = std::basic_istream<char>] <near match> operator>>(__istream_type& (*__pf)(__istream_type&)) ^ /usr/include/c++/4.8/istream:120:7: note: no known conversion for argument 1 from 'int' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&) {aka std::basic_istream<char>& (*)(std::basic_istream<char>&)}' /usr/include/c++/4.8/istream:124:7: note: std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::basic_istream<_CharT, _Traits>::__ios_type& (*)(std::basic_istream<_CharT, _Traits>::__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__istream_type = std::basic_istream<char>; std::basic_istream<_CharT, _Traits>::__ios_type = std::basic_ios<char>] <near match> operator>>(__ios_type& (*__pf)(__ios_type&)) ^ /usr/include/c++/4.8/istream:124:7: note: no known conversion for argument 1 from 'int' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&) {aka std::basic_ios<char>& (*)(std::basic_ios<char>&)}' /usr/include/c++/4.8/istream:131:7: note: std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__istream_type = std::basic_istream<char>] <near match> operator>>(ios_base& (*__pf)(ios_base&)) ^ /usr/include/c++/4.8/istream:131:7: note: no known conversion for argument 1 from 'int' to 'std::ios_base& (*)(std::ios_base&)' /usr/include/c++/4.8/istream:259:7: note: std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(std::basic_istream<_CharT, _Traits>::__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__streambuf_type = std::basic_streambuf<char>] <near match> operator>>(__streambuf_type* __sb); ^ /usr/include/c++/4.8/istream:259:7: note: no known conversion for argument 1 from 'int' to 'std::basic_istream<char>::__streambuf_type* {aka std::basic_streambuf<char>*}' inaltimetriunghi.cpp:7:11: error: 'c2' was not declared in this scope cin>>с1>>c2>>i; ^ inaltimetriunghi.cpp:7:15: error: 'i' was not declared in this scope cin>>с1>>c2>>i; ^ inaltimetriunghi.cpp:8:1: error: 'X' was not declared in this scope X= (float) c1*c2/i; x*=100; ^ inaltimetriunghi.cpp:8:12: error: 'c1' was not declared in this scope X= (float) c1*c2/i; x*=100; ^ inaltimetriunghi.cpp:8:21: error: 'x' was not declared in this scope X= (float) c1*c2/i; x*=100; ^ inaltimetriunghi.cpp:11:1: error: expected ';' before 'return' return 0; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema InaltimeTriunghi 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ă.