Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <algorithm>
- #include <string>
- #include <cstdio>
- using namespace std;
- string star(int n)
- {
- string answer;
- while(n--)
- answer+='*';
- return answer;
- }
- int main()
- {
- freopen("input.txt","r",stdin);
- vector <string> k;
- string sentence;
- int quantity;
- cin >> quantity;
- for (int i = 0; i < quantity; ++i)
- {
- string word;
- cin >> word;
- k.push_back(word);
- }
- while(cin>>sentence)
- {
- if(find(k.begin(),k.end(),sentence)!=k.end())cout<<star(sentence.length())<<' ';
- else cout<<sentence<<' ';
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement