Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
134873 欧阳俊懿 指针遍历数组II C++ Compile Error 0 MS 0 KB 524 2025-11-01 16:52:19

Tests(0/0):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int a[101]={},a; cin>>n; int *p=a; for(int i=0;i<n;i++){ cin>>a[i]; if((*p)%2==0)(*p)--; elae (*p)++; p++; } p=a; for(int i=0;i<n;i++){ cout<<*p<<" "; c++; } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:8:19: error: conflicting declaration 'int a'
     int a[101]={},a;
                   ^
Main.cc:8:9: note: previous declaration as 'int a [101]'
     int a[101]={},a;
         ^
Main.cc:9:10: error: 'n' was not declared in this scope
     cin>>n;
          ^
Main.cc:14:17: error: 'elae' was not declared in this scope
         elae (*p)++;
                 ^
Main.cc:20:9: error: 'c' was not declared in this scope
         c++;
         ^