杰拉斯的博客

[ACM_ZJUT_1048]注释

杰拉斯 杰拉斯 | 时间:2012-05-02, Wed | 15,155 views
编程算法 

注释

Time Limit:1000MS Memory Limit:32768K

Description

给出一个C++源程序代码。请将其中的注释去掉。

Sample Input


//======================

// simplest program

//======================
#include<iostream>
using namespace std;
//----------------------
int main(){
cout<<”hello world!\n”;
}//---------------------

Sample Output

#include<iostream>
using namespace std;
int main(){
cout<<”hello world!\n”;
}

超超级水题,心情不佳,做到水题发泄一下= =(好像有点滥竽充数的样子啊⊙﹏⊙b汗)

#include<iostream>
#include<string>
using namespace std;

int main(){
	string s;
	while(getline(cin, s)){
		for(int i = 0; i < s.length() - 1; ++i){
			if(s[i] == '\/' && s[i + 1] == '\/'){
				s.erase(s.begin() + i, s.end());
				break;
			}
		}
		if(s != "")
			cout << s << endl;
	}
}

如需转载请注明出处:杰拉斯的博客

相关文章

当前暂无评论 »