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 KatrineYang at 2016-05-27 12:18:44 on Problem 1401
直接贴代码
//============================================================================
// Name        : main1401.cpp
// Author      :
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <cmath>
using namespace std;

int powOf5[12] = {5, 25, 125, 625, 3125, 15625, 78125, 390625, 1953125, 9765625, 48828125, 244140625};

int main() {
	int cases;
	cin >> cases;
	for(int i = 0; i < cases; i++){
		int num;
		cin >> num;
		int res = 0;
		for(int j = 0; j < 12; j++){
			if(num < powOf5[j]) break;
			res += num/powOf5[j];
		}
		cout << res << endl;
	}

	//cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!
	return 0;
}

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