40分求助!
查看原帖
40分求助!
685824
shenyixuan123楼主2023/8/26 10:29

rt

#include<bits/stdc++.h>
using namespace std;
int main()
{
	char c;
	int x,s=0;
	cin>>x>>c;
	if(c=='y') s+=5;
	if(x<=1000) s+=8;
	else if(x>1000) 
	{
	    if(x-1000<500) s+=12;
	    else s+=ceil((x-1000)/500)*4+8;
	}
	cout<<s;
	return 0;
}
2023/8/26 10:29
加载中...