#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); vector<int> kand1; string s; for(int n=(cin>>n, n), i=0, a; kand1.size()<20; i++){ cin>>s>>a; if(s!="NIE" && (kand1.size()<10 || a<2)) kand1.push_back(i+1); } for(int i=0; i<20; i++) cout<<kand1[i]<<' '; return 0; }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | #include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); vector<int> kand1; string s; for(int n=(cin>>n, n), i=0, a; kand1.size()<20; i++){ cin>>s>>a; if(s!="NIE" && (kand1.size()<10 || a<2)) kand1.push_back(i+1); } for(int i=0; i<20; i++) cout<<kand1[i]<<' '; return 0; } |