解题思路:
注意事项:
参考代码:
import java.util.*;
public class Main{
public static void main(String[] args) {
int a;
int b;
Scanner sc = new Scanner(System.in
);
a=sc.nextInt();
if(a<=100000){b=a/10;System.out.print(+b);}
if(100000<a&&a<=200000){b=a/10+(a-100000)*75/1000;System.out.print(+b);}
if(200000<a&&a<=400000){b=a/10+(a-100000)*75/10+(a-200000)*5/100;System.out.print(+b);}
if(400000<a&&a<=600000){b=a/10+(a-100000)*75/10+(a-200000)*5/100+(a-400000)*3/100;System.out.print(+b);}
if(600000<a&&a<=1000000){b=a/10+(a-100000)*75/10+(a-200000)*5/100+(a-400000)*3/100+(a-600000)*15/1000;System.out.print(+b);}
if(a>1000000){b=a/10+(a-100000)*75/10+(a-200000)*5/100+(a-400000)*3/100+(a-600000)*15/1000+(a-1000000)/100;System.out.print(+b);}
}
}
0.0分
0 人评分
C语言训练-计算t=1+1/2+1/3+...+1/n (C语言代码)浏览:910 |
小明A+B (C语言代码)浏览:1317 |
C语言程序设计教程(第三版)课后习题6.2 (C语言代码)浏览:1432 |
【亲和数】 (C语言代码)浏览:541 |
WU-蓝桥杯算法提高VIP-Quadratic Equation (C++代码)浏览:1808 |
WU-蓝桥杯算法提高VIP-交换Easy (C++代码)浏览:1186 |
1009题解浏览:802 |
回文数字 (C语言代码)浏览:2539 |
矩形面积交 (C++代码)浏览:1204 |
C语言程序设计教程(第三版)课后习题10.1 (C语言代码)浏览:571 |