Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #include <ctype.h>
- int main()
- {
- char a[100];
- fgets(a,sizeof(a),stdin);
- char b[100] = "";
- int word = 1;
- for (int i=0;i<strlen(a);i++){
- if (isalpha(a[i])){
- if (islower(a[i])){
- a[i]-=' ';
- }else{
- a[i]+=' ';
- }
- }
- if (word%2 == 0){
- strncat(b,&a[i],1);
- }
- if (a[i] == ' '){
- word++;
- }
- }
- for (int i=strlen(b)-2;i>=0;i--){
- printf("%c",b[i]);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement