Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <ctype.h>
- #include <string.h>
- int main(int argc, char *argv[]) {
- char recenica[100+1];
- int i, n, m;
- scanf("%[^'.']", recenica);
- m=strlen(recenica);
- n=m/2;
- --m;
- for (i=0; i<n; ++i) {
- char temp=recenica[i];
- if(toupper(recenica[i])==toupper(recenica[m-i])) {
- temp=toupper(temp);
- recenica[i]=toupper(recenica[m-i]);
- recenica[m-i]=temp;
- }
- else {
- temp=tolower(temp);
- recenica[i]=tolower(recenica[m-i]);
- recenica[m-i]=temp;
- }
- }
- if((m+1)%2) {
- recenica[n]=toupper(recenica[n]);
- }
- printf("%s\n", recenica);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement