Created
May 25, 2022 15:00
-
-
Save chenbo515/8848973ac5a9c8ac60b2af46be0c83e1 to your computer and use it in GitHub Desktop.
comment counter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
*********** DO NOT CHANGE OR COMMIT THIS FILE *********** | |
Special cases that you'll need to handle. | |
There are: | |
- 5 single-line comments | |
- 23 multiple-line comments | |
*/ | |
main() | |
{ | |
printf( | |
"// This is not a comment" | |
"// This is not a comment\ | |
// This is not a comment" // Comment: single | |
"// This is not a comment \" not a comment as well" | |
"/* This is not a comment */" | |
"/* This is not a comment \ | |
This is not a comment */" | |
"This is not a comment */" | |
"// This line has a trailing comment" // Comment: \ | |
single (the line-break makes this one counted as 2 lines) | |
); /* Comment: multiple | |
Comment: multiple | |
Comment: multiple | |
*/ int x = 0; // Comment: multiple, single | |
/* | |
Comment: multiple | |
*/ int y = 1; /* | |
Comment: multiple */ | |
} | |
/* Comment: multiple | |
Comment: multiple \ | |
/* Comment: multiple | |
/* Comment: multiple | |
/* Comment: multiple | |
Comment: multiple */ // Comment: single // Not another single-line comment |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment