close
import java.io.*;
public class question08 {
public static void main(String args[])throws IOException {
BufferedReader buf=new BufferedReader(new InputStreamReader(System.in));
System.out.print("請輸入薪水值:");
int money=Integer.parseInt(buf.readLine());
int a=money/1000;
money=money%1000;
int b=money/500;
money=money%500;
int c=money/100;
money=money%100;
int d=money/50;
money=money%50;
int e=money/10;
money=money%10;
int f=money/5;
int g=money%5;
System.out.println("1000->"+a+",500->"+b+",100->"+c+",50->"+d+",10->"+e+",5->"+f+",1->"+g);
}
}
全站熱搜
留言列表