Codeforces Round #340 (Div. 2) A

Description

An elephant decided to visit his friend. It turned out that the elephant's house is located at point 0 and his friend's house is located at pointx(x > 0) of the coordinate line. In one step the elephant can move 1, 2, 3, 4 or 5 positions forward. Determine, what is the minimum number of steps he need to make in order to get to his friend's house.

Input

The first line of the input contains an integer x (1 ≤ x ≤ 1 000 000) — The coordinate of the friend's house.

Output

Print the minimum number of steps that elephant needs to make to get from point 0 to point x.

Sample test(s)
input
5
12
output
   1
3

真 - 水题 

#include<stdio.h>
//#include<bits/stdc++.h>
#include<string.h>
#include<iostream>
#include<math.h>
#include<sstream>
#include<set>
#include<queue>
#include<map>
#include<vector>
#include<algorithm>
#include<limits.h>
#define inf 0x3fffffff
#define INF 0x3f3f3f3f
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define LL long long
#define ULL unsigned long long
using namespace std;
int t;
int n,m;
int sum,ans,flag;
int a,b,c,d;
int main()
{
    cin>>n;
    if(n%5==0)
    {
        cout<<n/5;
    }
    else
    {
        cout<<n/5+1;
    }
    return 0;
}

  

原文地址:https://www.cnblogs.com/yinghualuowu/p/5160229.html