#include <iostream>
#include <cstring>
using namespace std;
int main()
{
char s[101];
cin.getline(s,101);
for(int i=0;i<strlen(s);i++)
if(s[i]=='.') //gasesc punct
{
int j=i-1;
while(s[j]>='0' && s[j]<='9') j--; //merg cu cifrele spre stanga
int k=i+1;
while(s[k]>='0' && s[k]<='9') k++; //merg cu cifrele spre dreapta
char aux[101];
strcpy(aux,s+k);
strcpy(s+j+1,aux); //sterg
i=j;
}
cout<<s;
return 0;
}
|