Submit | All submissions | Best solutions | Back to list |
NOCOMMEN - No comment |
Wersja polska | English version |
Your task is to remove all comments from C/C++ program.
There are 2 types of comments:
- multi-line:
/* comment */
- single-line:
// comment
However, You have to remember about the character \ which binds two consecutive lines. For example:
// this is a comment \
that's still a comment
Input
Program written in C/C++ with comments.
Warning: tests may contain characters of Ascii value greater than 127.
Output
The same program but without comments.
Warning: "Exact judge" is used in this problem, so you should not ignore any whitespaces in the output.
Example
Input:
// program which adds two numbers \ |
|
Added by: | Piotr Kąkol |
Date: | 2011-06-10 |
Time limit: | 5s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: SCM qobi |
hide comments
|
||||||
2011-08-09 19:44:13 Piotr KÄ…kol
Yes, it is. Yes, whitespace have to be preserved exactly. Nested comments? Can You give an example? Moreover: puts("// that's not a comment"); And one more test: printf("%c",'"'/*???*/); |
||||||
2011-08-09 19:15:36 HWK
What about: //\ /* int b; /**/ Is b defined? Must whitespace be preserved exactly? I guess nested comments are forbidden? Last edit: 2011-08-09 19:23:31 |