#include #include #include using namespace std; ifstream fin("date.in"); ofstream fout("date.out"); char a[200]; char *p; char b[200]; int main() { fin.get( a , 200 ); p = strchr( a , '-' ); while( p ) { if( a[ ( p - a - 1 ) ] != ' ') { strcpy( p , p+1 ); p = strchr( a , '-' ); } else { strcpy( a + ( p - a ) , p + 2); p = strchr(a, '-' ); } } p = strchr( a , '.' ); while(p) { strcpy( p , p+1 ); p = strchr( a , '.' ); } p = strchr( a , ',' ); while(p) { strcpy( b , p ); *p = ' '; strcpy( p + 1 , b ); p = strchr( p+2 , ',' ); } fout << a; return 0; }