#include<stdio.h> #define N 10 #define X 25//此处N为数组大小X为对比数大小可根据实际需要自行定义 void main(){ int a[N];//0~N-1 int i, j; for (i = 0; i < N;i++) scanf_s("%d", &a); for (i = 0; i < N-1; i++){ for (j = i; j < N; j++){ if a +a[j] == X printf("the sum of num %d,%d in the array is %d,they are %d,%d\n", i, j, X, a, a[j]);//红色部分有错,错误指示为: error C2061: syntax error : identifier 'a' } } } |