Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include <stdlib.h>
- #include <string.h>
- int proverka_iterativna(char *s) {
- int S = 0;
- int E = strlen(s) - 1;
- while(S <= E) {
- if(*(s + S) != *(s + E)) {
- return 0;
- }
- S += 1;
- E -= 1;
- }
- return 1;
- }
- //abca
- //S E
- int main(){
- char s[101];
- scanf("%s", s);
- if(proverka_iterativna(<#char *s#>)(s) == 1) {
- printf("PALINDROM\n");
- }
- else {
- printf("NE E PALINDROM\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement