Skip to content

Instantly share code, notes, and snippets.

@austa
Created March 19, 2013 16:37
Show Gist options
  • Select an option

  • Save austa/5197707 to your computer and use it in GitHub Desktop.

Select an option

Save austa/5197707 to your computer and use it in GitHub Desktop.
/*
* File: main.c
* Author: alaattin
*
* Created on 19 Mart 2013 Salı, 17:14
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/*
*
*/
int palindrom ( char [2][20]);
int main(int argc, char** argv) {
char string[2][20] = {"Aba", "AnAstAS mUM saTsana"};
printf("%d", palindrom(string));
return (EXIT_SUCCESS);
}
int palindrom ( char dizi1 [2][20]) {
int i = 0, son = 0, j = 0;
while(dizi1[i] != '\0' ) {
son = strlen(dizi1[i]) - 1;
for(j = 0; j <= strlen(dizi1[i]) - 1; j++){
printf("%c %c %d \n",dizi1[i][son],dizi1[i][j], j);
if(dizi1[i][j] == dizi1[i][son] || dizi1[i][j] == dizi1[i][son]+32 || dizi1[i][son] == dizi1[i][j]+32){
son--;
}
else{
return 0;
}
}
i++;
}
return 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment