Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
100506 谭思宸 12序列找规律 C++ Compile Error 0 MS 0 KB 304 2024-12-08 10:57:05

Tests(0/0):


Code:

#include<iostream> using namespace std; int main() { int n,i;=10000,j=10000,k; cin>>n; for(k=1;k<=(n-1)/2;k++) { i--; j-=2; } if(n%2) cout<<i<<endl; else cout<<j<<endl; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:5:16: error: expected primary-expression before '=' token
        int n,i;=10000,j=10000,k;
                ^
Main.cc:5:23: error: 'j' was not declared in this scope
        int n,i;=10000,j=10000,k;
                       ^
Main.cc:5:31: error: 'k' was not declared in this scope
        int n,i;=10000,j=10000,k;
                               ^