2023年码蹄杯高职组决赛 小码哥锻炼 题型:模拟 难度:白银

103 阅读1分钟

码题集OJ-小码哥锻炼 (matiji.net)

#include<bits/stdc++.h>
using namespace std;
int cnt;
int main()
{
    int n;cin>>n;
    
    while(n>=13)
    {
    	n-=13;
    	cnt++;
	}
	while(n>=7)
	{
		n-=7;
		cnt++;
	}
	while(n>=3)
	{
		n-=3;
		cnt++;
	}
	while(n>=1)
	{
		n-=1;
		cnt++;
	}
	cout<<cnt<<endl;
	return 0;
}

image.png