CCF201912-1

CCF201912-1

#include<iostream>
#include<vector>

using namespace std;
bool have(int x){
	if(x%7==0)
		return true;
	while(x!=0){
		if(x%10==7)
			return true;
		x = x / 10;
	}
	return false;
}
void func(){
	int n;
	cin>>n;
	vector<int> ans(4,0);
	int index = 0;
	int num = 1;
	for(int i=0;i<n;i++){
		if(have(num)){
			ans[index]++;
			i--;
		}
		
		num++;
		index = (index + 1) % 4;
	}
	for(int i=0;i<4;i++){
		cout<<ans[i]<<endl;
	}
}

int main(){
	func();
	return 0;
}

發佈了48 篇原創文章 · 獲贊 8 · 訪問量 1922
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章