/ Vijos /

记录详情

Compile Error

foo.cpp:1:1: error: 'include' does not name a type
 include<iostream> include <string>
 ^
foo.cpp:3:1: error: 'string' does not name a type
 string trans(string ori)
 ^
foo.cpp:7:86: error: 'string' does not name a type
 for(int i=0;i<ori.size();i++) { tmp[head]=ori[tail]; head++; tail--; } return tmp; } string prev(string ori,int k) { string tmp=ori; for(int i=0;i<ori.size();i++) { int code=ori[i]-k; if(code<97) code=123-(97-code); tmp[i]=code; } return tmp; } string next(string ori,int k) { string tmp=ori; for(int i=0;i<ori.size();i++) { int code=ori[i]+k; if(code>122) code=96+(code-122);
                                                                                      ^
foo.cpp:7:246: error: 'string' does not name a type
 for(int i=0;i<ori.size();i++) { tmp[head]=ori[tail]; head++; tail--; } return tmp; } string prev(string ori,int k) { string tmp=ori; for(int i=0;i<ori.size();i++) { int code=ori[i]-k; if(code<97) code=123-(97-code); tmp[i]=code; } return tmp; } string next(string ori,int k) { string tmp=ori; for(int i=0;i<ori.size();i++) { int code=ori[i]+k; if(code>122) code=96+(code-122);
                                                                                                                                                                                                                                                      ^
foo.cpp: In function 'int main()':
foo.cpp:15:1: error: 'string' was not declared in this scope
 string str[4],ans,res;
 ^
foo.cpp:17:7: error: 'cin' was not declared in this scope
 while(cin>>n)
       ^
foo.cpp:19:28: error: 'str' was not declared in this scope
 for(int i=1;i<=3;i++) cin>>str[i];
                            ^
foo.cpp:23:1: error: 'ans' was not declared in this scope
 ans=trans(str[1]);
 ^
foo.cpp:23:11: error: 'str' was not declared in this scope
 ans=trans(str[1]);
           ^
foo.cpp:23:17: error: 'trans' was not declared in this scope
 ans=trans(str[1]);
                 ^
foo.cpp:24:15: error: 'prev' was not declared in this scope
 if((prev(ans,i)==str[2]&&next(ans,i)==str[3])||(prev(ans,i)==str[3]&&next(ans,i)==str[2])) {res=ans;break;}
               ^
foo.cpp:24:36: error: 'next' was not declared in this scope
 if((prev(ans,i)==str[2]&&next(ans,i)==str[3])||(prev(ans,i)==str[3]&&next(ans,i)==str[2])) {res=ans;break;}
                                    ^
foo.cpp:24:93: error: 'res' was not declared in this scope
 if((prev(ans,i)==str[2]&&next(ans,i)==str[3])||(prev(ans,i)==str[3]&&next(ans,i)==str[2])) {res=ans;break;}
                                                                                             ^
foo.cpp:27:15: error: 'prev' was not declared in this scope
 if((prev(ans,i)==str[1]&&next(ans,i)==str[3])||(prev(ans,i)==str[3]&&next(ans,i)==str[1])) {res=ans;break;}
               ^
foo.cpp:27:36: error: 'next' was not declared in this scope
 if((prev(ans,i)==str[1]&&next(ans,i)==str[3])||(prev(ans,i)==str[3]&&next(ans,i)==str[1])) {res=ans;break;}
                                    ^
foo.cpp:27:93: error: 'res' was not declared in this scope
 if((prev(ans,i)==str[1]&&next(ans,i)==str[3])||(prev(ans,i)==str[3]&&next(ans,i)==str[1])) {res=ans;break;}
                                                                                             ^
foo.cpp:30:15: error: 'prev' was not declared in this scope
 if((prev(ans,i)==str[1]&&next(ans,i)==str[2])||(prev(ans,i)==str[2]&&next(ans,i)==str[1])) {res=ans;break;}
               ^
foo.cpp:30:36: error: 'next' was not declared in this scope
 if((prev(ans,i)==str[1]&&next(ans,i)==str[2])||(prev(ans,i)==str[2]&&next(ans,i)==str[1])) {res=ans;break;}
                                    ^
foo.cpp:30:93: error: 'res' was not declared in this scope
 if((prev(ans,i)==str[1]&&next(ans,i)==str[2])||(prev(ans,i)==str[2]&&next(ans,i)==str[1])) {res=ans;break;}
                                                                                             ^
foo.cpp:32:1: error: 'cout' was not declared in this scope
 cout<<res<<endl;
 ^
foo.cpp:32:7: error:

信息

递交者
类型
递交
题目
P1449 字符串还原
语言
C++
递交时间
2016-02-18 00:28:31
评测时间
2016-02-18 00:28:32
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes