Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
76749 张誉腾 数列求和 C++ Compile Error 0 MS 0 KB 203 2024-06-02 17:21:40

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ int a; cin>>a; int n[a+1]; for(int i=2;i<=n;i++){ n[i]=n[i-1]*2; } int sum=0; for(int i=1;i<=n;i++){ sum+=n[i]; } }


Run Info:

Main.cc: In function 'int main()':
Main.cc:9:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
  for(int i=2;i<=n;i++){
                 ^
Main.cc:13:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
  for(int i=1;i<=n;i++){
                 ^