/ Vijos /

记录详情

Compile Error

foo.cpp:5:11: error: 'int y1' redeclared as different kind of symbol
 int x1,x2,y1,y2,n,rb=0;
           ^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\cmath:44:0,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\random:38,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algo.h:65,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\algorithm:62,
                 from foo.cpp:2:
c:\mingw\include\math.h:263:24: error: previous declaration of 'double y1(double)'
 _CRTIMP double __cdecl y1 (double);
                        ^
foo.cpp: In function 'int main()':
foo.cpp:20:8: 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>>n;
        ^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\iostream:40:0,
                 from foo.cpp:3:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\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)]'
     operator>>(basic_istream<_CharT, _Traits>&& __is, _Tp& __x)
     ^
foo.cpp:24:49: error: invalid operands of types 'int' and 'double(double)' to binary 'operator-'
         a[i].s1=(a[i].x-x1)*(a[i].x-x1)+(a[i].y-y1)*(a[i].y-y1);
                                                 ^
foo.cpp:24:61: error: invalid operands of types 'int' and 'double(double)' to binary 'operator-'
         a[i].s1=(a[i].x-x1)*(a[i].x-x1)+(a[i].y-y1)*(a[i].y-y1);
                                                             ^

信息

递交者
类型
递交
题目
P1810 导弹拦截
语言
C++
递交时间
2016-08-29 21:21:39
评测时间
2016-08-29 21:21:39
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes