fork download
  1. #include <iostream>
  2. #include<string>
  3. #include<queue>
  4. using namespace std;
  5.  
  6. int main() {
  7. while(1){
  8. int n;
  9. cin>>n;
  10. if(n==0)return 0;
  11. string s;
  12. queue<string> q;
  13. for(int i=0;i<n;i++){
  14. cin>>s;
  15. q.push(s);
  16. }
  17. cout<<q.front()<<endl;
  18. }
  19. return 0;
  20. }
Success #stdin #stdout 0s 15232KB
stdin
9
do
the
best
and
enjoy
today
at
acm
icpc
14
oh
yes
by
far
it
is
wow
so
bad
to
me
you
know
hey
15
abcde
fghijkl
mnopq
rstuvwx
yzz
abcde
fghijkl
mnopq
rstuvwx
yz
abcde
fghijkl
mnopq
rstuvwx
yz
0
stdout
do
oh
abcde