Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- #include <iomanip>
- #include <string>
- using namespace std;
- int main()
- {
- int x,n, y = 0 , u=0;
- string p, s , r[200];
- bool e;
- cin >> x;
- for (int i = 1; i <= x; i++){
- cin >> n;
- cin >> p;
- for (int j = 0; j <= n; j++){
- getline(cin, s);
- for (unsigned int i = 0; i < p.length(); i++){
- if (p[i] == s[i]){
- e = true;
- }
- else{
- e = false; break;
- }
- }
- if (e == true){
- y++;
- r[u] = s;
- u++;
- }
- }
- if (y > 0){
- cout << y << endl;
- for (int i = u; i >= 0; i--){
- cout << r[i] << endl;
- }
- y = 0;
- u = 0;
- }
- else cout << "Conan's assumption is wrong!" << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement