90分蒟蒻求助
查看原帖
90分蒟蒻求助
488395
Proxima_Centauri楼主2022/7/12 19:32
下面是我的代码(注:B2048)
求各位大佬帮忙改一下谢谢
有点丑······```
#include <iostream>
#include <cmath>
using namespace std;

int main()
{
    int x;
    char y;
    cin >> x >> y;
    int ans = 8;
    if (y == 'y') ans += 5;
    int temp = (x - 1000) / 500;
    if ((x - 1000) % 500 != 0) temp++;
    cout << ans + temp * 4 << endl;
    return 0;
}
2022/7/12 19:32
加载中...