用来吃输入的回车89intmain()10{11while(scanf("%d", &n) !=EOF)12{13gets(tmp);//吃回车1415//输入16for(inti =0; i < n; i++)17{18input[i] =getchar();1920gets(tmp);//吃回车21}2223//处理,贪心算法24intidx =0;//输出的索引2526ints =0;/...
c =getchar();if(c !='\n'&& c !=' ') cows[idx++] = c;if(idx >= N)break; }//reverse the cowsfor(intidx =0, l =0, r = N-1; idx < N; ){boolleft =false;for(inti =0; l + i < r; ++i){//only in the equal case we have to move the two pointers...if(cows...