提交时间:2022-07-12 18:18:07

运行 ID: 46126

#include<bits/stdc++.h> using namespace std; int n,ans,i1; int main(){ cin>>n; for(int i=1;i<=n;i++){ if(i%4==0)ans++; else if(i%7==0)ans++; i1=i; while(i1){ if(i1%10==4&&i1/10%10==4)ans++; else if(i1%10==7&&i1/10%10==7)ans++; i1/=10; } } cout<<ans; return 0; }