为社么0分?

P1085 [NOIP2004 普及组] 不高兴的津津

哥你是不是交错题了
by FDsama @ 2024-04-13 15:54:33


交错了
by LYQ_666 @ 2024-04-13 15:56:00


??? ~~楼主关联题是不是写错了~~ 好吧反正这是代码 ```cpp #include<bits/stdc++.h> using namespace std; int main () { int n,m,s,max=0,i,d=0; for(i=1;i<8;i++) { cin>>n>>m; s=n+m; if(s>max && s>8) { max=s; d=i; } } cout<<d; return 0; } //很久以前写的,不知道可不可以优化 ```
by gao_shou @ 2024-04-13 15:56:37


@[zcy0826](/user/535920) the ans: ```cpp #include <iostream> using namespace std; int main() { int unhappy[7] = {0}, maxDay = 0, max = 0; for (int i = 0; i < 7; i++) { int inclass, others; cin >> inclass >> others; unhappy[i] = others + inclass - 8; if (unhappy[i] > 0 && unhappy[i] > max){ maxDay = i + 1; max = unhappy[i]; } } cout << maxDay << endl; return 0; } ```
by Enoch2013 @ 2024-04-13 16:02:06


@[zcy0826](/user/535920) 哥们交错题了
by Steve_xh @ 2024-04-13 16:05:54


@[FDsama](/user/1057308) 啊?我记得是啊???qwq
by zcy0826 @ 2024-04-20 14:06:45


@[FDsama](/user/1057308) 想起来了,这个好像是买铅笔的 qwq
by zcy0826 @ 2024-04-20 14:09:48


也不是买铅笔的!!!
by zcy0826 @ 2024-04-20 14:15:41


``` #include <iostream> using namespace std; int main() { int a,b,p,max=0,i,day=0; for(i=1;i<=7;i++) { cin>>a>>b; p=a+b; if(p>max&&p>8) { max=p; day=i; } } cout<<day; return 0; } ```
by zcy0826 @ 2024-04-20 14:38:34


``` #include<bits/stdc++.h> using namespace std; int main () { int n,m,s,max=0,i,d=0; for(i=1;i<8;i++) { cin>>n>>m; s=n+m; if(s>max && s>8) { max=s; d=i; } } cout<<d; return 0; } ```
by zenglicheng666 @ 2024-06-23 11:40:22


|