这种题就是难者不会,会者不难。

博客讲的很详细了

代码:

#include <bits/stdc++.h>
using namespace std;
string s;
int read() {
	int n;
	scanf("%d", &n);
	for (int i = 1; i <= n; i++)
		cin >> s;
	return n;
}
int main() {
	while(1) {
		printf("next 0\n");
		fflush(stdout);
		read();
		printf("next 0 1\n");
		fflush(stdout);
		if(read() == 2) break;
	}
	while(1) {
		printf("next 0 1 2 3 4 5 6 7 8 9\n");
		fflush(stdout);
		if(read() == 1) {
			printf("done\n");
			fflush(stdout);
			break;
		}
	}
} 

  

相关文章:

  • 2021-06-24
  • 2021-07-09
  • 2021-08-17
  • 2021-10-20
  • 2022-02-10
  • 2022-12-23
  • 2021-08-23
  • 2021-08-27
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-03-07
  • 2021-05-23
  • 2021-12-28
  • 2021-05-29
  • 2021-07-04
相关资源
相似解决方案