/ Vijos /

记录详情

Compile Error

foo.cpp:1:1: error: 'include' does not name a type
 include<iostream>
 ^
foo.cpp:4:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
 main()
      ^
foo.cpp: In function 'int main()':
foo.cpp:6:32: error: 'cin' was not declared in this scope
 long long n,x,i=0,sum=0,j,z,m; cin>>n; do { i++; sum+=i; } while(sum<n); j=i-1; z=j-sum+n+1; m=sum-n+1; if(j%2!=0) if(m==1) cout<<z; else cout<<z<<"/"<<m; else if(z==1) cout<<m; else cout<<m<<"/"<<z; }
                                ^
foo.cpp:6:125: error: 'cout' was not declared in this scope
 long long n,x,i=0,sum=0,j,z,m; cin>>n; do { i++; sum+=i; } while(sum<n); j=i-1; z=j-sum+n+1; m=sum-n+1; if(j%2!=0) if(m==1) cout<<z; else cout<<z<<"/"<<m; else if(z==1) cout<<m; else cout<<m<<"/"<<z; }
                                                                                                                             ^
foo.cpp:6:139: error: 'cout' was not declared in this scope
 long long n,x,i=0,sum=0,j,z,m; cin>>n; do { i++; sum+=i; } while(sum<n); j=i-1; z=j-sum+n+1; m=sum-n+1; if(j%2!=0) if(m==1) cout<<z; else cout<<z<<"/"<<m; else if(z==1) cout<<m; else cout<<m<<"/"<<z; }
                                                                                                                                           ^
foo.cpp:6:170: error: 'cout' was not declared in this scope
 long long n,x,i=0,sum=0,j,z,m; cin>>n; do { i++; sum+=i; } while(sum<n); j=i-1; z=j-sum+n+1; m=sum-n+1; if(j%2!=0) if(m==1) cout<<z; else cout<<z<<"/"<<m; else if(z==1) cout<<m; else cout<<m<<"/"<<z; }
                                                                                                                                                                          ^
foo.cpp:6:184: error: 'cout' was not declared in this scope
 long long n,x,i=0,sum=0,j,z,m; cin>>n; do { i++; sum+=i; } while(sum<n); j=i-1; z=j-sum+n+1; m=sum-n+1; if(j%2!=0) if(m==1) cout<<z; else cout<<z<<"/"<<m; else if(z==1) cout<<m; else cout<<m<<"/"<<z; }
                                                                                                                                                                                        ^
foo.cpp:6:13: warning: unused variable 'x' [-Wunused-variable]
 long long n,x,i=0,sum=0,j,z,m; cin>>n; do { i++; sum+=i; } while(sum<n); j=i-1; z=j-sum+n+1; m=sum-n+1; if(j%2!=0) if(m==1) cout<<z; else cout<<z<<"/"<<m; else if(z==1) cout<<m; else cout<<m<<"/"<<z; }
             ^

信息

递交者
类型
递交
题目
P1333 Cantor表
语言
C++
递交时间
2014-09-05 21:02:17
评测时间
2014-09-05 21:02:18
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes