Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- //#include <fstream>
- using namespace std;
- bool comment(string &s);
- int main()
- {
- string s;
- //fstream ci;
- //ci.open("text.txt");
- while(getline(cin,s)){
- if(!comment(s))
- cout<<s<<endl;
- }
- }
- bool comment(string &s){
- bool com=false;
- for(int i=0;i<s.size();i++){
- if(s[i]!=' ')
- if(s[i]=='#'){
- com=true;
- break;
- }
- else break;
- }
- return com;
- }
Add Comment
Please, Sign In to add comment