错了?我不理解
  • 板块灌水区
  • 楼主cxk_ctrl
  • 当前回复7
  • 已保存回复7
  • 发布时间2024/5/3 07:14
  • 上次更新2024/5/3 10:57:45
查看原帖
错了?我不理解
1210072
cxk_ctrl楼主2024/5/3 07:14

B2048

#include<bits/stdc++.h>
using namespace std;
int main(){
	long long int kg,he=8;
	bool jj;
	cin>>kg>>jj;
	if(jj=='y')
	{
		he=he+5;
	}
	if(kg>1000)
	{
		kg=kg-1000;
        he=he+(kg/500)*4;
        if(kg%500!=0)
		{
       		he=he+4;
		}
	}
	if(kg<=1000)
	{
		he=he+5;
	}
	cout<<he;
	return 0;
}
2024/5/3 07:14
加载中...