Advertisement
Guest User

reverse every 5 chars in C

a guest
Feb 25th, 2020
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.31 KB | None | 0 0
  1. #include "pch.h"
  2. #include <iostream>
  3. #include "stdio.h"
  4. int inverse()
  5. {
  6.     int c = 0;
  7.     char a;
  8.     scanf("%c", &a);
  9.     if (a != '.') {
  10.         if (c != 5)
  11.         {
  12.             c = c + 1;
  13.             inverse();
  14.             printf("%c", a);
  15.         };
  16.         return 1;
  17.     };
  18.     return 0;
  19. }
  20. int main()
  21. {
  22.     inverse();
  23.     while (inverse() == 1) inverse();
  24.    
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement