Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
128210 徐毅然 指针遍历数组 C++ Wrong Answer 1 MS 260 KB 705 2025-08-11 10:43:26

Tests(0/10):


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 N; scanf("%d", &N); // 读取数组长度 int arr[100]; // 定义数组 int *p = arr; // 定义指针并指向数组首地址 // 输入数组元素 for(int i = 0; i < N; i++) { scanf("%d", p + i); } // 使用指针遍历输出数组 printf("数组元素为:"); for(int i = 0; i < N; i++) { printf("%d ", *(p + i)); } return 0; }


Run Info:

------Input------
40 198 249 870 416 658 45 227 11 897 272 965 161 627 100 193 235 432 866 270 593 219 876 562 803 594 6 302 623 772 516 48 92 108 645 959 887 93 393 140 772
------Answer-----
198 249 870 416 658 45 227 11 897 272 965 161 627 100 193 235 432 866 270 593 219 876 562 803 594 6 302 623 772 516 48 92 108 645 959 887 93 393 140 772
------Your output-----
数组元素为:198 249 870 416 658 45 227 11 897 272 965 161 627 100 193 235 432 866 270 593 219 876 562 803 594 6 302 623 772 516 48 92 108 645 959 887 93 393 140 772