BUPT-homework/semester3/pset1/7-3-central-list-ARRAY.c

23 lines
346 B
C
Raw Normal View History

2022-11-20 21:22:03 +08:00
// 20:50 - 21:00
#include <stdio.h>
#define MAX 100
int main(void) {
int arr[MAX];
int counter = 0;
while (scanf("%d,", &arr[counter]) != EOF) {
counter++;
}
for (int i = 0, end = counter / 2; i < end; i++) {
if (arr[i] != arr[counter - i - 1]) {
printf("No");
return 0;
}
}
printf("Yes");
return 0;
}