``return sum*-base;``改为``return sum*base;``
by cecilia_sankta @ 2018-10-03 07:41:09
快读常数太大了,读这么小的数据会负优化
by hpbl @ 2018-10-03 07:41:27
long long乘int不太好吧...
by 权御天下 @ 2018-10-03 07:47:22
@[lhy930](/space/show?uid=60899) 谢谢!
by WangRui @ 2018-10-03 12:19:54
@[a11186192](/space/show?uid=107494) 谢谢!
by WangRui @ 2018-10-03 12:20:01
@[权御天下](/space/show?uid=59082) 那请问是不是要将int base改为long long base呢?
by WangRui @ 2018-10-03 12:20:39
#include<iostream>
using namespace std;
int main()
{
int a,sum=1;
while(cin>>a) //cin输入
{
if(a!=42) //判断是不是四十二
{
if(sum)cout<<a<<endl; //如果之前没有出现过四十二,输出
}
else
sum=0; // 表示四十二出现了
}
}
by DreamFox @ 2019-08-17 10:09:40
希望更丰富的展现?使用Markdown
by Halex @ 2020-05-07 11:28:26
@[flys](/user/237940) 学长就这就这?
by GodStudy @ 2020-07-24 15:44:41
我 考 我 自 己
by DreamFox @ 2020-07-25 14:44:30