Advertisement
leminhkt

noname65

Jul 7th, 2020
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.53 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;//                                        |\__/,|   (`\
  3. //                                                          _.|o o  |_   ) )
  4. /// ================================= Main part ===========(((===(((=============
  5.  
  6.  
  7. int main(){
  8.     int n; cin >> n;
  9.     while(n--){
  10.         string s; getline(cin, s);
  11.         bool f = 1;
  12.         for(char i : s)
  13.             if(i == ' '){
  14.                 if(f++ == 0) putchar(' ');
  15.             }
  16.             else if(f)
  17.                 putchar(i & '_'), f = 0;
  18.             else
  19.                 putchar(i | ' ');
  20.         putchar('\n');
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement