#933
DistantaPunctDreapta
Se dau în plan, un punct și o dreaptă. Să se determine distanța de la punct la dreaptă.
Problema | DistantaPunctDreapta | Operații I/O |
distantapunctdreapta.in /distantapunctdreapta.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #50267267 | Utilizator | |
Fișier | distantapunctdreapta.cpp | Dimensiune | 741 B |
Data încărcării | 02 Aprilie 2024, 20:03 | Scor / rezultat | Eroare de compilare |
distantapunctdreapta.cpp: In function 'int distanta(int, int, int, int)': distantapunctdreapta.cpp:10:25: error: expression cannot be used as a function return (x2-x1)(x2-x1) + (y1-y2)*(y1-y2); ^ distantapunctdreapta.cpp: At global scope: distantapunctdreapta.cpp:12:17: error: 'int y1' redeclared as different kind of symbol int x1, x2, x3, y1, y2, y3, x4, y4, dist; ^ 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 distantapunctdreapta.cpp:1: /usr/include/i386-linux-gnu/bits/mathcalls.h:241:1: error: previous declaration of 'double y1(double)' __MATHCALL (y1,, (_Mdouble_)); ^ distantapunctdreapta.cpp: In function 'int main()': distantapunctdreapta.cpp:17: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 distantapunctdreapta.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) ^ distantapunctdreapta.cpp:19:39: error: 'det' was not declared in this scope int a = det(x1, y1, x2, y2, x3, y3); ^ distantapunctdreapta.cpp:21:25: error: 'h' was not declared in this scope double i = a / sqrt(h); ^ distantapunctdreapta.cpp:22:36: error: 'setprecision' was not declared in this scope fout << fixed << setprecision(2) << (int)(h*100)/100.0; ^ distantapunctdreapta.cpp:21:12: warning: unused variable 'i' [-Wunused-variable] double i = a / sqrt(h); ^ distantapunctdreapta.cpp: In function 'int distanta(int, int, int, int)': distantapunctdreapta.cpp:11:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema DistantaPunctDreapta 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ă.