Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <sstream>
- #include <string>
- using namespace std;
- main(){
- string sentance;
- getline(cin,sentance);
- istringstream istr(sentance);
- string word;
- int maxSig=INT_MIN;
- string longest;
- bool check=false;
- while(istr>>word)
- {
- size_t sizeW= word.size();
- string noise;
- for(int a =0;a<sizeW; ++a)
- {
- if(word[a]>='0' && word[a]<='9')
- {
- continue;
- }
- else{
- noise+=word.at(a);
- check=true;
- }
- }
- int scheck=noise.size();
- if(maxSig<=scheck)
- {
- maxSig=noise.length();
- if(longest>noise || longest.empty()){
- longest=noise;
- }
- }
- }
- if(check==true){
- cout << longest;
- }else
- {
- cout<<"no noise";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement