Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <math.h>
- int main() {
- system("cls");
- //INPUT - @STUDENT:ADD YOUR CODE FOR INPUT HERE:
- int a[100], n;
- bool check = true;
- scanf("%d", &n);
- for (int i = 0; i<n; i++) {
- scanf("%d", &a[i]);
- }
- for (int i = 0; i<n; i++) {
- if (a[i]%2 == 0) {
- check = false;
- break;
- }
- }
- if (check == true && n>=2) {
- int x;
- if (n%2 == 1) x = n/2;
- else x = n/2-1;
- for (int i = 0; i<=x; i++) {
- if (a[i] != a[n-1-i]) {
- check = false;
- break;
- }
- }
- }
- // Fixed Do not edit anything here.
- printf("\nOUTPUT:\n");
- //@STUDENT: WRITE YOUR OUTPUT HERE:
- printf("%d", check);
- //--FIXED PART - DO NOT EDIT ANY THINGS HERE
- printf("\n");
- system ("pause");
- return(0);
- }
Add Comment
Please, Sign In to add comment