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

为什么会WA?

Posted by mzfor2004 at 2009-03-19 22:09:57 on Problem 1401
#include<iostream>
using namespace std;

void ans(int num){
	int a,b,t;
	a=0;
	b=5;
	while(b<=num){
		a=a+(num/b);
		b=b*5;
	}
	cout<<a<<endl;
}


int main(void){
	int times;
	int num;
	cin>>times;
	for(int i=0;i<times;i++){
		cin>>num;
		if(num==0||num==1){
			cout<<"1"<<endl;

		}
		else{
			ans(num);
		}
	}
	return 0;
}
各位帮忙看一下吧,为什么会WA,谢谢了.

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