Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
139526 赵锦鹏 指针遍历数组 C++ Compile Error 0 MS 0 KB 169 2025-12-07 15:30:31

Tests(0/0):


Code:

#include <iostream> using namespace std; int main() { int a[150]; int *p=a for(int i=0;i<100;i++) { cin>>a[i]; cout<<*p<<" "; p++; } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:7:2: error: expected ',' or ';' before 'for'
  for(int i=0;i<100;i++)
  ^
Main.cc:7:14: error: 'i' was not declared in this scope
  for(int i=0;i<100;i++)
              ^
Main.cc:6:7: warning: unused variable 'p' [-Wunused-variable]
  int *p=a
       ^