#927
DistantaPuncte
Se dau coordonatele în plan a două puncte. Să se afișeze pătratul distanței dintre ele.
Problema | DistantaPuncte | Operații I/O |
distantapuncte.in /distantapuncte.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #15396452 | Utilizator | |
Fișier | distantapuncte.cpp | Dimensiune | 393 B |
Data încărcării | 12 Aprilie 2019, 14:56 | Scor / rezultat | Eroare de compilare |
distantapuncte.cpp:8:8: error: 'int y1' redeclared as different kind of symbol int x1,y1,x2,y2; ^ 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 distantapuncte.cpp:1: /usr/include/i386-linux-gnu/bits/mathcalls.h:241:1: error: previous declaration of 'double y1(double)' __MATHCALL (y1,, (_Mdouble_)); ^ distantapuncte.cpp: In function 'int main()': distantapuncte.cpp:16:12: error: cannot bind 'std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}' lvalue to 'std::basic_istream<char>&&' cin>>x1>>y1>>x2>>y2; ^ 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 distantapuncte.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) ^ distantapuncte.cpp:18:19: warning: pointer to a function used in arithmetic [-Wpointer-arith] int dy=y1-y2; ^ distantapuncte.cpp:18:18: error: invalid conversion from 'double (*)(double)throw ()' to 'int' [-fpermissive] int dy=y1-y2; ^ distantapuncte.cpp:14:47: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result] freopen("distantapuncte.in","r",stdin); ^ distantapuncte.cpp:15:49: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result] freopen("distantapuncte.out","w",stdout); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema DistantaPuncte 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ă.