提示: 欢迎访问OurACM平台。
Problem 1604 Delete the comments

Accept: 101    Submit: 760
Time Limit: 1000 mSec    Memory Limit : 32768 KB

Problem Description

Adding comments in code is very important for teamwork, code maintenance and the preparation of modules. Let’s know how to use comments in C. There are two ways to comment in C and you can look for detail in the book “ISO C99 standard” or "ISO C++2003 standard". 1、The characters “ /* ” introduce a comment. The contents of such a comment are examined only to identify multibyte characters and to find the characters “ */ ” that terminate it. This way can be across multiple lines, and can be placed anywhere in your code. The string between “ /*…*/ ” will not be parsed by compiler. We can used it in the front of our procedures to enhance the readability of the code. For example:

2、The characters “//” introduce a comment that includes all multibyte characters up to, but not including, the next new-line character. The contents of such a comment are examined only to identify multibyte characters and to find the terminating new-line character. This is common in C, and it has great flexibility, the whole line will not be seen as the comments. When the compiler compiles your code, the code will be deleted which is commented. The commented code will not be display. Now, the question to you, for a given section of code, can you separate the comment from the code.

Input

There is only one test data, the input data has many lines, so you have to deal with up to EOF. Given you to the code string S, S’s length is less than 50,000 and the length of each line is not more than 80.

Output

Replace the comments by spaces and output the string.

Sample Input

if(a>b){ /* int temp = a; /* swap a and b */ a=b; b=temp; */ } /*Matching last priority*// /*//*/ /*

Sample Output

if(a>b){ a=b; b=temp; */ } / /*

Hint

We use '$' character represents space for clarification, so the sample is shown as follows:

Sample Input for clarification

if(a>b){
$/*$int$temp$=$a;$$/*$swap$a$and$b$*/
$$a=b;
$$b=temp;
$*/
}
/*Matching$last$priority*//
/*//*/
/*

Sample Output for clarification

if(a>b){
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$a=b;
$$b=temp;
$*/
}
$$$$$$$$$$$$$$$$$$$$$$$$$$/
$$$$$$
/*

Source

FOJ月赛-2008年5月

Submit  Back  Status  Discuss