Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

Question
|%Y0 l. lin. e
Z. Clean Code
time limit per test: 1 seconde
memory limit per test: 256 megabytes
input: standard input
output: standard output
Given a source code in C++. Print the source code after cleaning it as follows :
1. If there are comments you have to remove them all whether it's a single
comment (e.g. : //) or a block comment (e.g.: /**/).
2. If there are any blank lines or lines consists of spaces you must remove them
all.
See the test cases carefully for more clarifications.
Input
Source code in C++ (maximum number of lines is 50).
Output
Print the clean code according to the problem statement.
Example
input
Соpy
// I am a single comment and you must remove me : ((
I am a block comment and you must remove me
* /
#include<iostream>
using namespace std;
int main () {
int a, b;
cin
a » b; // Reading two variables from user (please remove
>>
me !! :
cout «
а + b « endl:
// End of the program (remove me please :) )
return 0 ;
output
Соpy
#include<iostream>
using namespace std;
int main () {
int a, b ;
cin » a » b;
cout
« а + b « endl;
return 0;
}
Note
Please be careful in handling the priority of comments.
Comment symbols may be included in comments and it's not guaranteed that the
resulting source code is a valid C++ syntax.
Codeforces (c) Copvriaht 2010-2021 Mike Mirzavanov
II
>
expand button
Transcribed Image Text:|%Y0 l. lin. e Z. Clean Code time limit per test: 1 seconde memory limit per test: 256 megabytes input: standard input output: standard output Given a source code in C++. Print the source code after cleaning it as follows : 1. If there are comments you have to remove them all whether it's a single comment (e.g. : //) or a block comment (e.g.: /**/). 2. If there are any blank lines or lines consists of spaces you must remove them all. See the test cases carefully for more clarifications. Input Source code in C++ (maximum number of lines is 50). Output Print the clean code according to the problem statement. Example input Соpy // I am a single comment and you must remove me : (( I am a block comment and you must remove me * / #include<iostream> using namespace std; int main () { int a, b; cin a » b; // Reading two variables from user (please remove >> me !! : cout « а + b « endl: // End of the program (remove me please :) ) return 0 ; output Соpy #include<iostream> using namespace std; int main () { int a, b ; cin » a » b; cout « а + b « endl; return 0; } Note Please be careful in handling the priority of comments. Comment symbols may be included in comments and it's not guaranteed that the resulting source code is a valid C++ syntax. Codeforces (c) Copvriaht 2010-2021 Mike Mirzavanov II >
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education