请求帮忙,谢谢
查看原帖
请求帮忙,谢谢
920234
froth_reciprocal楼主2023/8/1 15:43
50分,我也不知道为什么
#include<iostream>
#include<cstdlib>
#include<iomanip>
#include<cstdio>
#include<cstring>
#include<cmath>
using namespace std;
int main(){
	int x,ans;char c;cin>>x>>c;
	if(x<=1000)	ans=8;
	if(x>1000){
		int p=x-1000;
		if(p%500==0){
			ans=8+p/500*4; 
		}else	ans=8+(p/500+1)*4;
	}
	if(c='y')	ans+=5;
	cout<<ans<<endl;
	return 0;
}
2023/8/1 15:43
加载中...