#929
Se dau un punct și un segment în plan. Să se verifice dacă punctul se găsește pe segment.
| Problema | PunctSegment | Operații I/O |
punctsegment.in/punctsegment.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #61813057 | Utilizator | |
| Fișier | punctsegment.cpp | Dimensiune | 446 B |
| Data încărcării | 10 Decembrie 2025, 22:30 | Scor/rezultat | Eroare de compilare |
punctsegment.cpp:7:17: 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/assert.h:35, from /usr/include/c++/4.8/cassert:43, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:33, from punctsegment.cpp:1: /usr/include/i386-linux-gnu/bits/mathcalls.h:241:1: error: previous declaration of 'double y1(double)' __MATHCALL (y1,, (_Mdouble_)); ^ punctsegment.cpp: In function 'int main()': punctsegment.cpp:11: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/sstream:38:0, from /usr/include/c++/4.8/complex:45, from /usr/include/c++/4.8/ccomplex:38, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52, from punctsegment.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) ^ punctsegment.cpp:12:51: warning: pointer to a function used in arithmetic [-Wpointer-arith] if ((x1 - x2) * (y3 - y2) - (x3 - x2) * (y1 - y2) == 0) ^ punctsegment.cpp:12:53: error: invalid operands of types 'int' and 'double (*)(double)throw ()' to binary 'operator*' if ((x1 - x2) * (y3 - y2) - (x3 - x2) * (y1 - y2) == 0) ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema PunctSegment 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ă.