Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /******************************************************************************
- Welcome to GDB Online.
- GDB online is an online compiler and debugger tool for C, C++, Python, PHP, Ruby,
- C#, VB, Perl, Swift, Prolog, Javascript, Pascal, HTML, CSS, JS
- Code, Compile, Run and Debug online from anywhere in world.
- *******************************************************************************/
- #include <iostream>
- #include <string>
- #include <vector>
- using namespace std;
- int main()
- {
- string str = "qweeaasdzxc";
- vector<string> vec {"qwee", "dfg", "ss", "zxc", "eaa"};
- int kol = 0;
- string vowels = "eyuioa";
- for (auto &s : vec){
- char pc = '.';
- for (auto &cc : s){
- if (cc == pc && vowels.find(cc) != string::npos){
- kol++;
- break;
- }
- pc = cc;
- }
- }
- cout << 100 * kol / vec.size() << "%\n";
- string sentence;
- int count = 0;
- for (auto &s : vec)
- if (str.find(s) != string::npos){
- count++;
- for (int i = 0; i < count; i++)
- sentence.append("*");
- sentence.append(s + " ");
- }
- cout << sentence << "\n";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement