#include <iostream>
using namespace std;
int n;
int counter=0;
string yesno;
int Wystepy;
int wynik[20];
int main()
{
cin>>n;
for(int i=0;i<n;i++)
{
cin>>yesno>>Wystepy;
if(((counter<20)&&(yesno=="TAK"))&&((Wystepy<2)||(counter<10)))
{
wynik[counter]=i+1;
counter++;
}
}
for(int i=0;i<20;i++)
{
cout<<wynik[i]<<" ";
}
return 0;
}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | #include <iostream> using namespace std; int n; int counter=0; string yesno; int Wystepy; int wynik[20]; int main() { cin>>n; for(int i=0;i<n;i++) { cin>>yesno>>Wystepy; if(((counter<20)&&(yesno=="TAK"))&&((Wystepy<2)||(counter<10))) { wynik[counter]=i+1; counter++; } } for(int i=0;i<20;i++) { cout<<wynik[i]<<" "; } return 0; } |
English