Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main()
- {
- string str;
- getline(cin, str);
- string key[] = {"for", "if", "double", "int", "string", "else", "char", "while"};
- int length = sizeof(key)/sizeof(key[0]);
- for(int i=0; i<length; i++){
- string found = key[i];
- if(str.find(found) != string::npos) {
- cout << found << " -> yes" << endl;
- } else {
- cout << found << " -> no" << endl;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement