Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <stdbool.h>
- int main ()
- {
- int size = 0;
- int *a = (int*)malloc(size*sizeof(int));
- int j;
- bool tstr = 1;
- char c;
- while(c != '\n'){
- a = (int*)realloc(a, (size+1)*sizeof(int));
- scanf("%d%c", &a[size++], &c);
- }
- for(int i =0, j = size -1; i<j && tstr; i++, j--)
- tstr = (a[i] == a[j]);
- printf("%s\n", tstr? "yes": "no");
- free(a);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement