#930
IntersectieSegmente
Se dau două segmente în plan, specificate prin coordonatele capetelor. Să se verifice dacă au cel puțin un punct comun.
Problema | IntersectieSegmente | Operații I/O |
![]() intersectiesegmente.in /intersectiesegmente.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #57385147 | Utilizator | |
Fișier | intersectiesegmente.cpp | Dimensiune | 1.34 KB |
Data încărcării | 28 Martie 2025, 12:00 | Scor / rezultat | Eroare de compilare |
intersectiesegmente.cpp:5:21: error: 'int y1' redeclared as different kind of symbol int x1, x2, x3, x4, y1, y2, y3, y4; ^ 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 intersectiesegmente.cpp:1: /usr/include/i386-linux-gnu/bits/mathcalls.h:241:1: error: previous declaration of 'double y1(double)' __MATHCALL (y1,, (_Mdouble_)); ^ intersectiesegmente.cpp: In function 'int main()': intersectiesegmente.cpp:31:8: 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>>x4>>y4; ^ 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 intersectiesegmente.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) ^ intersectiesegmente.cpp:32:46: error: invalid conversion from 'double (*)(double)throw ()' to 'int' [-fpermissive] if (punctPeSegment(x1, y1, x2, y2, x3, y3)) ^ intersectiesegmente.cpp:12:5: error: initializing argument 2 of 'int punctPeSegment(int, int, int, int, int, int)' [-fpermissive] int punctPeSegment (int x1, int y1, int x2, int y2, int x3, int y3) ^ intersectiesegmente.cpp:34:25: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings] msgAndOut("DA\n"); ^ intersectiesegmente.cpp:36:46: error: invalid conversion from 'double (*)(double)throw ()' to 'int' [-fpermissive] if (punctPeSegment(x1, y1, x2, y2, x4, y4)) ^ intersectiesegmente.cpp:12:5: error: initializing argument 2 of 'int punctPeSegment(int, int, int, int, int, int)' [-fpermissive] int punctPeSegment (int x1, int y1, int x2, int y2, int x3, int y3) ^ intersectiesegmente.cpp:38:25: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings] msgAndOut("DA\n"); ^ intersectiesegmente.cpp:40:46: error: invalid conversion from 'double (*)(double)throw ()' to 'int' [-fpermissive] if (punctPeSegment(x3, y3, x4, y4, x1, y1)){ ^ intersectiesegmente.cpp:12:5: error: initializing argument 6 of 'int punctPeSegment(int, int, int, int, int, int)' [-fpermissive] int punctPeSegment (int x1, int y1, int x2, int y2, int x3, int y3) ^ intersectiesegmente.cpp:41:25: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings] msgAndOut("DA\n"); ^ intersectiesegmente.cpp:45:25: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings] msgAndOut("DA\n"); ^ intersectiesegmente.cpp:47:31: error: invalid conversion from 'double (*)(double)throw ()' to 'int' [-fpermissive] d1 = det(x3,y3,x4,y4,x1,y1); ^ intersectiesegmente.cpp:7:5: error: initializing argument 6 of 'int det(int, int, int, int, int, int)' [-fpermissive] int det(int x1, int y1, int x2, int y2, int x3, int y3) ^ intersectiesegmente.cpp:49:31: error: invalid conversion from 'double (*)(double)throw ()' to 'int' [-fpermissive] d3 = det(x1,y1,x2,y2,x3,y3); ^ intersectiesegmente.cpp:7:5: error: initializing argument 2 of 'int det(int, int, int, int, int, int)' [-fpermissive] int det(int x1, int y1, int x2, int y2, int x3, int y3) ^ intersectiesegmente.cpp:50:31: error: invalid conversion from 'double (*)(double)throw ()' to 'int' [-fpermissive] d4 = det(x1,y1,x2,y2,x4,y4); ^ intersectiesegmente.cpp:7:5: error: initializing argument 2 of 'int det(int, int, int, int, int, int)' [-fpermissive] int det(int x1, int y1, int x2, int y2, int x3, int y3) ^ intersectiesegmente.cpp:53:25: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings] msgAndOut("DA\n"); ^ intersectiesegmente.cpp:55:25: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings] msgAndOut("NU\n"); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema IntersectieSegmente 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ă.