Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- int x = 0;
- int y = 0;
- char Feld[50];
- printf("gebe die buchstaben eines wortes nacheinander ein und am ende eine 0\n");
- while (y != 1)
- {
- scanf("%c",&Feld[x]);
- if (Feld[x]=='0')
- {
- y=1;
- }
- x++;
- }
- x--;
- while (x>=0)
- {
- printf("%c",Feld[x]);
- if (Feld[x-1]!=Feld[(x-(x-1))])
- {
- y++;
- }
- x--;
- }
- if (y==0)
- {
- printf("das wort ist ein palindrom");
- }
- else
- {
- printf("das wort ist kein palindrom");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement