47 lines
885 B
C
47 lines
885 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <stdbool.h>
|
|
|
|
bool retr(char *arr) {
|
|
bool ans = true;
|
|
int i = 0, j = strlen(arr) - 2;
|
|
//printf("%d", j);
|
|
while (i < j) {
|
|
//printf("{%c, %c}", arr[i], arr[j]);
|
|
if (arr[i] != arr[j]) {
|
|
ans = false;
|
|
break;
|
|
}
|
|
i++; j--;
|
|
}
|
|
return ans;
|
|
}
|
|
|
|
typedef void (*func) (int a, int b);
|
|
int cmp(const void* a, const void* b){
|
|
return *(int*)a - *(int*)b;
|
|
}
|
|
|
|
typedef enum Gender{
|
|
Male = 0,
|
|
Female = 1
|
|
} Gender;
|
|
|
|
typedef struct {
|
|
char name[20];
|
|
int age;
|
|
Gender gender;
|
|
} Teacher;
|
|
|
|
int main() {
|
|
char arr[1000];
|
|
int as[] = {0, 5, 6, 4, 2};
|
|
fgets(arr, 1000, stdin);
|
|
printf(retr(arr) ? "Is Palindrome\n" : "Isn't Palindrome\n");
|
|
qsort(as, 5, sizeof(int), &cmp);
|
|
return 0;
|
|
}
|
|
|
|
// ok so this could actually be working
|