#928
AriaTriunghi
Se dau coordonatele în plan a trei puncte. Să se afișeze valoarea ariei triunghiului pe care îl formează.
Problema | AriaTriunghi | Operații I/O |
ariatriunghi.in /ariatriunghi.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #43843997 | Utilizator | |
Fișier | ariatriunghi.cpp | Dimensiune | 544 B |
Data încărcării | 19 Mai 2023, 14:01 | Scor / rezultat | Eroare de compilare |
ariatriunghi.cpp:6:20: error: 'int y1' redeclared as different kind of symbol int x1 , x2 , x3 , y1 , y2 , y3; ^ In file included from /usr/include/features.h:374:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/os_defines.h:39, from /usr/include/i386-linux-gnu/c++/4.8/bits/c++config.h:426, from /usr/include/c++/4.8/iosfwd:38, from /usr/include/c++/4.8/ios:38, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/fstream:38, from ariatriunghi.cpp:1: /usr/include/i386-linux-gnu/bits/mathcalls.h:241:1: error: previous declaration of 'double y1(double)' __MATHCALL (y1,, (_Mdouble_)); ^ ariatriunghi.cpp: In function 'int main()': ariatriunghi.cpp:10:9: error: cannot bind 'std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}' lvalue to 'std::basic_istream<char>&&' fin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3; ^ In file included from /usr/include/c++/4.8/fstream:38:0, from ariatriunghi.cpp:1: /usr/include/c++/4.8/istream:872:5: error: initializing argument 1 of 'std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&&, _Tp&) [with _CharT = char; _Traits = std::char_traits<char>; _Tp = double(double)throw ()]' operator>>(basic_istream<_CharT, _Traits>&& __is, _Tp& __x) ^ ariatriunghi.cpp:11:43: warning: pointer to a function used in arithmetic [-Wpointer-arith] double a = sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2)); ^ ariatriunghi.cpp:11:51: warning: pointer to a function used in arithmetic [-Wpointer-arith] double a = sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2)); ^ ariatriunghi.cpp:11:53: error: invalid operands of types 'double (*)(double)throw ()' and 'double (*)(double)throw ()' to binary 'operator*' double a = sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2)); ^ ariatriunghi.cpp:12:43: error: invalid operands of types 'int' and 'double(double)throw ()' to binary 'operator-' double b = sqrt((x3-x1)*(x3-x1) + (y3-y1)*(y3-y1)); ^ ariatriunghi.cpp:12:51: error: invalid operands of types 'int' and 'double(double)throw ()' to binary 'operator-' double b = sqrt((x3-x1)*(x3-x1) + (y3-y1)*(y3-y1)); ^ ariatriunghi.cpp:16:36: error: 'setprecision' was not declared in this scope fout << fixed << setprecision(1) << A; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema AriaTriunghi 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ă.