长长的代码
2026-07-26 13:16:45
发布于:广东
6阅读
0回复
0点赞
很简单,先当普通数学题算一遍,再转换C++语言。
点个赞吧!上代码!
#include <exception>
#include <iostream>
using namespace std;
int main(){
int x,m;
char c;
cin >> x;
cin >> c;
if(x<=1000){
if(c=='y'){
cout << "13";
}
else{
cout << "8";
}
}
else{
if(c=='y'){
if((x-1000)%500==0){
cout << (x-1000)/500*4+13;
}
else{
cout << (x-1000)/500*4+17;
}
}
else{
if((x-1000)%500==0){
cout << (x-1000)/500*4+8;
}
else{
cout << (x-1000)/500*4+12;
}
}
}
return 0;
}
这里空空如也





有帮助,赞一个