1 条题解
-
0
C :
#include<stdio.h> #include<string.h> int main() { long lr; float jj; scanf("%ld",&lr); if(lr<=100000) jj=lr*0.1; else if(lr<=200000) jj=100000*0.1+(lr-100000)*0.075; else if(lr<=400000) jj=100000*(0.1+0.075)+(lr-200000)*0.05; else if(lr<=600000) jj=100000*(0.1+0.075)+200000*0.05+(lr-200000)*0.03; else if(lr<=1000000) jj=100000*(0.1+0.075)+200000*0.05+200000*0.03+(lr-200000)*0.015; else jj=100000*(0.1+0.075)+200000*0.05+200000*0.03+200000*0.015+(lr-200000)*0.01; printf("%.0f\n",jj); return 0; }
C++ :
#include<algorithm> #include<iostream> #include<string> using namespace std; int main() { double s, i; cin >> i; if(i <= 100000) s = i * 0.1; else if(i <= 200000) s = 10000 + (i - 100000) * 0.075; else if(i <= 400000) s = 10000 + 7500 + (i - 200000) * 0.05; else if(i <= 600000) s = 10000 + 7500 + 10000 + (i - 400000) * 0.03; else if(i <= 1000000) s = 10000 + 7500 + 10000 + 6000 + (i - 600000) * 0.015; else s = 27500 + 6000 + 60000 + (i - 1000000) * 0.01; cout << s << endl; return 0; }
- 1
信息
- ID
- 2698
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- (无)
- 标签
- 递交数
- 0
- 已通过
- 0
- 上传者