sdnu1250递归

1250.F.陆历川让你A个题
Description

This a veryyyyyyyyyyyyyy hard problem.One day, Lulichuan was played in city X with his friend, they like to paly a game called hide and seek,they was playing hide-and-seek, and suddenly a gust of wind blew up. The wind rolled up all the dust, so they went into a house to take refuge and stayed in the house so boring that they turned around. At the time, a small partner discovered a strange house. His surroundings were gleaming. At this time they cautiously walked into this shimmering room. They found an ancient cheat in the room. With ancient books, if anyone can solve for the number of zeros at the end of a number’ factorial .who will get a mysterious treasure, they soon find out the answer, but they are afraid of making mistakes, so they hope you can count them again. In order to help them test the answer.

Input

The first line T(0 < T< 1000)Follow T line every line a N(0 < N < 1000000)

Output

Answer

Sample Input

2
5
6

Sample Output

1
1

找n中有多少个5相乘 递归水题

#include<bits/stdc++.h>
using namespace std;
int digui(int n)
{
   
    if(n==0||n==1)
        return 0;
    else
        return n/5+digui(n/5);
}
int main()
{
   
    int n,t,m;
    scanf("%d",&t);
    while(t--)
    {
   
        scanf("%d",&n);
        int ans;
        ans=digui(n);
        cout<<ans<<'\n';
    }
    return 0;
}

全部评论

相关推荐

饥饿的长颈鹿就要上岸...:简历五项结构 简历只放五项内容,顺序和格式如下: 一、个人信息 只写名字、电话、邮箱 不写性别、年龄、籍贯、政治面貌、微信等额外信息 二、教育经历 格式:学校名称 | 学历 | 专业 | 就读时间 从左到右排列,一行写完 如果专业和岗位对口,写1-2行主修课程;不对口就不写 学历如果不占优势,可以把教育经历放到简历靠后的位置 三、实习/项目经历 如果没有实习经历,全部写项目经历 每条经历格式:项目名 + 岗位名 + 任职时间段 下面写三到五条工作内容 每条工作内容开头必须用四个字概括,加粗,后面跟一条完整描述 所有描述必须用STAR法则来写(情境-任务-行动-结果) 每一条都要有数据支撑和具体成果 四、个人优势 可以写获得的奖项、证书 如果奖项不够,就写你熟练掌握的技能 每条也要有具体数据或成果支撑,不能空泛堆砌 五、整体要求 一页纸,不要超过一页 个人信息只写名字加电话邮箱 贝贝试一下这个方式写简历,我虽然没收到offer,至少收到了好几轮面试
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务