Advertisement
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 isSymmetric(int arr[], int size) {
- int i;
- for(i = 0; i < size/2; i++) {
- if (arr[i] != arr[size-i-1]) {
- return 0;
- }
- }
- return 1;
- }
- int main() {
- system("cls");
- //INPUT - @STUDENT:ADD YOUR CODE FOR INPUT HERE:
- int i, n, a[10], sum;
- scanf("%d", &n);
- for(i = 0; i < n; i++) {
- scanf("%d", &a[i]);
- }
- int check = 0;
- for(i = 0; i < n; i++) {
- if (a[i] % 2 == 1) {
- check = 1;
- break;
- }
- }
- // Fixed Do not edit anything here.
- printf("\nOUTPUT:\n");
- //@STUDENT: WRITE YOUR OUTPUT HERE:
- if (isSymmetric(a, n) == 0 && check == 1) {
- printf("1");
- } else {
- printf("0");
- }
- //--FIXED PART - DO NOT EDIT ANY THINGS HERE
- printf("\n");
- system ("pause");
- return(0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement