Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
Tags
- 오라클
- 노리로또
- 응용 프로그램 내 구입
- 크롬 타임아웃
- 윈도우10 vpn
- 랍스터 찜
- 10원단위 올림
- 강화 프로방스
- 크롬 인너넷연결 안됨
- 크롬 인터넷연결
- Windows10
- 코로나백신
- 10 올림
- 분기날짜
- 코로나백신 부작용
- 신주쿠맛집
- 코로나백신 갈증
- 코로나백신 어지러움
- 화이자백신
- 로니세라
- takanaru
- 안드로이드폰 위치
- windows10 크롬
- 신주쿠 로컬식당
- 코로나백신이상증상
- windows10 cisco vpn
- 타카마루
- 핸드폰 찾기
- cisco vpn
- 성수족발
Archives
- Today
- Total
이거 맘대로 되는 세상이 아니구만...
[JAVA]자바 기초 로직 잔돈계산을 시스템창으로 출력하기 본문
반응형
class Ja{
public static void main(String args[]){
int a=Integer.parseInt(args[0]);
int b=Integer.parseInt(args[1]);
int s=a-b;
int c,d,e,f,g,h;
c=d=e=f=g=h=0;
c=s/5000;
h=s%5000;
d=h/1000;
h=h%1000;
e=h/500;
h=h%500;
f=h/100;
h=h%100;
g=h/50;
h=h%50;
h=h/10;
System.out.println("손님이지불한금액 ="+a);
System.out.println("손님이 구입한금액 ="+b);
System.out.println("<<<잔돈내역>>>");
System.out.println("거스름돈 ="+s);
System.out.println("오천원="+c+"개");
System.out.println("천원="+d+"개");
System.out.println("오백원="+e+"개");
System.out.println("백원="+f+"개");
System.out.println("오십원="+g+"개");
System.out.println("십원="+h+"개");
}
}
public static void main(String args[]){
int a=Integer.parseInt(args[0]);
int b=Integer.parseInt(args[1]);
int s=a-b;
int c,d,e,f,g,h;
c=d=e=f=g=h=0;
c=s/5000;
h=s%5000;
d=h/1000;
h=h%1000;
e=h/500;
h=h%500;
f=h/100;
h=h%100;
g=h/50;
h=h%50;
h=h/10;
System.out.println("손님이지불한금액 ="+a);
System.out.println("손님이 구입한금액 ="+b);
System.out.println("<<<잔돈내역>>>");
System.out.println("거스름돈 ="+s);
System.out.println("오천원="+c+"개");
System.out.println("천원="+d+"개");
System.out.println("오백원="+e+"개");
System.out.println("백원="+f+"개");
System.out.println("오십원="+g+"개");
System.out.println("십원="+h+"개");
}
}
반응형
Comments