20分求助!
查看原帖
20分求助!
620260
chickencxk楼主2022/2/28 19:12
#include <iostream>
#include <cmath>
using namespace std;
int main (){
    int x;
    char c;
    cin >> x >> c;
    if(x<=1000 && c==110){
        cout << 8;
    }else if (x>1000 && c==110 && x%500!=0){
        cout << 8+ceil(1.0*x/500)*4;
    }else if (x>1000 && c==121 && x%500!=0){
        cout << 8+ceil(1.0*x/500)*4+5;
    }else if(x>1000 && c==121 && x%500==0){
        cout << 8+x/500*4+5;
    }else if (x<=1000 && c==121){
        cout << 8+5;
    }else if (x>1000 && c==110 && x%500==0){
        cout << 8+x/500*4;
    }
    return 0;
}
2022/2/28 19:12
加载中...