View Code of Problem 84

#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main() {
   string str;
    while (getline(cin,str)) {
        for (int i = 0; str[i] != '\0'; i++)
        {
            if ((str[i] == 's' || str[i] == 'S') && (str[i + 1] == 'a' || str[i + 1] == 'A') && 
                (str[i + 2] == 'l' || str[i + 2] == 'L') && (str[i + 3] == 't' || str[i + 3] == 'T')
                )
                cout << str << endl;
        }
    }
    return 0;
}

Double click to view unformatted code.


Back to problem 84