Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

一道水题,实现了我的一百道!

Posted by wangbaobao at 2009-05-03 09:21:17 on Problem 3085
#include"iostream"
using namespace std;
int main()
{
	int n,num=0;
	cin>>n;
	while(n--)
	{
		num++;
		int money;
		cin>>money;
		int a,b,c,d;
		a=money/25;
		money=money%25;
		b=money/10;
		money=money%10;
		c=money/5;
		money=money%5;
		d=money/1;
 cout<<num<<" "<<a<<" QUARTER(S), "<<b<<" DIME(S), "<<c<<" NICKEL(S), "<<d<<" PENNY(S)"<<endl;
	}
return 1;
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator