枚举 本文最后更新于 2024-08-06T14:24:20+08:00 枚举,就是列举所有情况,最终得出答案。 例题洛谷P1085 [NOIP2004 普及组] 不高兴的津津 枚举一周的每一天打擂台即可。 123456789101112131415#include <bits/stdc++.h>using namespace std;int x, y, maxn = 8, day;int main(int argc, char const *argv[]){ for (int i = 1; i < 8; i++) { scanf("%d%d", &x, &y); if (x + y > maxn) maxn = x + y, day = i; } printf("%d", day); return 0;} 算法笔记 #枚举 枚举 http://example.com/2024/02/21/枚举/ 作者 zhrleo 发布于 2024年2月21日 许可协议 进位制 上一篇 模拟 下一篇 Please enable JavaScript to view the comments