Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- struct przy{
- char wyksz;
- string imie;
- };
- int main() {
- int n;
- cin >> n;
- przy tab[n];
- for(int i=0;i<n;i++){
- cin >> tab[i].imie >> tab[i].wyksz;
- }
- string c;
- cin >> c;
- for(int i=0;i<n;i++){
- if(c=="w") cout << tab[i].imie<<endl;
- if(c=="s"){
- if(tab[i].wyksz='p') cout << tab[i].imie <<endl;
- if(tab[i].wyksz='s') cout << tab[i].imie <<endl;
- if(tab[i].wyksz='g') cout << tab[i].imie <<endl;
- }
- if(c=="g"){
- if(tab[i].wyksz='p') cout << tab[i].imie <<endl;
- if(tab[i].wyksz='g') cout << tab[i].imie <<endl;
- }
- if(c=="p"){
- if(tab[i].wyksz='p') cout << tab[i].imie <<endl;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement