View Code of Problem 114

#include<bits/stdc++.h>
using namespace std;

int main(void)
{
  string s,str;
  int i,j;
  while(getline(cin,s))
  {
    for(i=0;i<s.size();++i)
    {
      if(isalpha(s[i]))
        str+=s[i];
      else
      {
        cout<<str<<s[i];
        str="";
      }
    }
    cout<<endl;
  }
}

Double click to view unformatted code.


Back to problem 114