Advertisement
aiNayan

272

Dec 27th, 2020 (edited)
748
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.52 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. int main()
  4. {
  5.     int i, count = 0,length;
  6.     char s[100];
  7.     while (gets(s))
  8.     {
  9.        length = strlen(s);
  10.         for (i = 0; i <length; i++)
  11.         {
  12.             if (s[i] == '"')
  13.             {
  14.                 count+= 1;
  15.                 if (count % 2 == 1)
  16.                     printf("``");
  17.                 else
  18.                     printf("''");
  19.             }
  20.             else
  21.                 printf("%c", s[i]);
  22.         }
  23.         printf("\n");
  24.     }
  25.     return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement