/ Vijos /

记录详情

Compile Error

foo.cpp:6:8: error: expected '}' before ';' token
  cin>>n;
        ^
foo.cpp:6:5: error: invalid user-defined conversion from 'std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}' to 'int' [-fpermissive]
  cin>>n;
     ^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\ios:44:0,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\ostream:38,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\iostream:39,
                 from foo.cpp:1:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\basic_ios.h:115:7: note: candidate is: std::basic_ios<_CharT, _Traits>::operator void*() const [with _CharT = char; _Traits = std::char_traits<char>] <near match>
       operator void*() const
       ^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\basic_ios.h:115:7: note:   no known conversion for implicit 'this' parameter from 'void*' to 'int'
foo.cpp:7:2: error: expected unqualified-id before 'for'
  for(i=1;i<=n;i++) t[i%3]=(t[(i+1)%3]+t[(i-1+3)%3])%7654321;
  ^
foo.cpp:7:10: error: 'i' does not name a type
  for(i=1;i<=n;i++) t[i%3]=(t[(i+1)%3]+t[(i-1+3)%3])%7654321;
          ^
foo.cpp:7:15: error: 'i' does not name a type
  for(i=1;i<=n;i++) t[i%3]=(t[(i+1)%3]+t[(i-1+3)%3])%7654321;
               ^
foo.cpp:8:5: error: 'cout' does not name a type
     cout<<t[n%3];
     ^
foo.cpp:9:2: error: expected unqualified-id before 'return'
  return 0;
  ^
foo.cpp:10:1: error: expected declaration before '}' token
 }
 ^

信息

递交者
类型
递交
题目
P1093 文科生的悲哀
语言
C++
递交时间
2016-11-27 17:25:46
评测时间
2016-11-27 17:25:47
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes