请问大佬哪里错了= =

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

其实完全不必要这么麻烦 ```cpp #include<iostream> int a,b; int main(){ for(int i=1;i<=7;i++){ std::cin>>a>>b; if(a+b>8){ std::cout<<i<<std::endl; break; } } return 0; } ```
by Burnside @ 2018-10-22 14:41:14


~~你输出0后应该直接return 0;的~~
by Zeril @ 2018-10-22 14:43:03


@[Burnside](/space/show?uid=64500) 刚入坑没多久,原谅我看不懂这代码。。。
by Catmint @ 2018-10-22 14:46:09


@[皇斌丞](/space/show?uid=66073) 加上了还是不行= =
by Catmint @ 2018-10-22 14:46:25


@[Catmint](/space/show?uid=141881) ~~您最后一层循环不应该是<7吗~~
by Zeril @ 2018-10-22 14:49:41


@[皇斌丞](/space/show?uid=66073) 7个元素,循环6次,直接arr[5]和arr[6]比较了就完了,小于7的话第7个元素没的比较。
by Catmint @ 2018-10-22 14:52:29


@[Catmint](/space/show?uid=141881) 可你不触犯if,c怎么有值呢
by Zeril @ 2018-10-22 14:53:46


触发
by Zeril @ 2018-10-22 14:53:57


@[皇斌丞](/space/show?uid=66073) 哦,我靠,我应该把这个镶嵌到if里面,失策,谢了= =
by Catmint @ 2018-10-22 14:56:42


@[Catmint](/space/show?uid=141881) 其实您只需要一次循环找MAX
by Zeril @ 2018-10-22 15:01:24


|