Advertisement
nikitakrut58

kr 5

Dec 10th, 2019
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.55 KB | None | 0 0
  1.     #include <iostream>
  2.     #include <fstream>
  3.     #include <string>
  4.     #include <math.h>
  5.  
  6.  
  7.     using namespace std;
  8.  
  9.  
  10.     int main(){
  11.         int k=0;
  12.         string s;
  13.         getline (cin, s);
  14.        
  15.        
  16.         int dlin=(int)s.length();
  17.         for(int i=0;i<dlin;i++){
  18.             if(s[i]==' '){
  19.                 if(k==0){
  20.                     cout<<"";
  21.                     k++;
  22.                 }else{
  23.                     cout<<s[i];
  24.                 }
  25.             }else{
  26.                 cout<<s[i];
  27.             }
  28.     }
  29.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement