거스름 돈 구하기
2010. 3. 25. 10:52ㆍ2010년/30계단1~2단계
#include<stdio.h>
int main()
{
int imoney;//초기값
int ishow;//거스름돈
int ime; //100원짜리
int ithe;//50원짜리
int ipower; // 10원 짜리
printf("지불해야할 돈을 입력하세요 \n");
scanf("%d",&imoney);
ishow=1000-imoney;
ime=ishow/100;
ishow=ishow-ime*100;
ithe=ishow/50;
ishow=ishow-ithe*50;
ipower=ishow/10;
printf("%d %d %d",ime,ithe,ipower);
return 0;
}
머리를 이상하게 굴렸다 -_-;;
'2010년 > 30계단1~2단계' 카테고리의 다른 글
퓨즈 구하기 (0) | 2010.03.25 |
---|---|
손해본 금액 구하기 (0) | 2010.03.25 |
문자열의 카운트! (0) | 2010.03.11 |
좌표의 위치 구하기 (0) | 2010.03.10 |
두분수를 입력받아서 곱과 합을 구하는것 (0) | 2010.03.10 |