30分代码!求助
查看原帖
30分代码!求助
560902
yuyue_JOY楼主2021/8/27 21:23
#include<iostream>
#include<cmath>
#include<string>
using namespace std;				
int main()
{ 
    int x,v,e;
	string a;
	cin>>x>>a;
	e=x-1000;
    if(x<=1000 && a=="y") v=8+5;
    else if(x<=1000 && a=="n") v=8;
    else if(x>1000 && a=="y" && e<500) v=8+4*1+5;
    else if(x>1000 && a=="y" && e>=500) v=8+4*((x-1000)/500)+5;
    else if(x>1000 && a=="n" && e<500) v=8+4*1;
    else if(x>1000 && a=="n" && e>=500) v=8+4*((x-1000)/500);
    cout<<v;
    return 0;
}
2021/8/27 21:23
加载中...