Advertisement
Guest User

F

a guest
Sep 24th, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.51 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<string.h>
  3. int main()
  4. {
  5.     char str[10000000];
  6.     int i,cnt=0;
  7.     for(i=0;scanf("%c",&str[i])!=EOF;i++){
  8.         if(str[i]=='"'){
  9.             cnt++;
  10.             if(cnt%2!=0){
  11.                 str[i]='`';
  12.                 i++;
  13.                 str[i]='`';
  14.             }
  15.             else{
  16.                 str[i]='\'';
  17.                 i++;
  18.                 str[i]='\'';
  19.             }
  20.         }
  21.     }
  22.     for(i=0;str[i];i++){
  23.         printf("%c",str[i]);
  24.     }
  25.     return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement