/ Vijos /

记录详情

Compile Error

foo.cpp: In function 'int main()':
foo.cpp:7:22: warning: for increment expression has no effect [-Wunused-value]
     for(int i=1;i++;i<=n)
                      ^
foo.cpp:9:13: error: 'cin' was not declared in this scope
             cin>>a[i]>>b[i];
             ^
foo.cpp:9:13: note: suggested alternative:
In file included from foo.cpp:1:0:
C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/iostream:60:18: note:   'std::cin'
   extern istream cin;  /// Linked to standard input
                  ^
foo.cpp:12:19: error: 'sort' was not declared in this scope
     sort(w+1,w+n+1);
                   ^
foo.cpp:12:19: note: suggested alternative:
In file included from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/algorithm:62:0,
                 from foo.cpp:2:
C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/stl_algo.h:4705:5: note:   'std::sort'
     sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
     ^
foo.cpp:15:12: error: 'i' was not declared in this scope
     ans/=b[i];
            ^
foo.cpp:16:5: error: 'cout' was not declared in this scope
     cout<<ans<<endl;
     ^
foo.cpp:16:5: note: suggested alternative:
In file included from foo.cpp:1:0:
C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/iostream:61:18: note:   'std::cout'
   extern ostream cout;  /// Linked to standard output
                  ^
foo.cpp:16:16: error: 'endl' was not declared in this scope
     cout<<ans<<endl;
                ^
foo.cpp:16:16: note: suggested alternative:
In file included from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/iostream:39:0,
                 from foo.cpp:1:
C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/ostream:564:5: note:   'std::endl'
     endl(basic_ostream<_CharT, _Traits>& __os)
     ^

信息

递交者
类型
递交
题目
P1779 国王游戏
语言
C++
递交时间
2015-10-20 19:31:32
评测时间
2015-10-20 19:31:34
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes