提交时间:2022-07-12 09:45:39
运行 ID: 45981
#include<iostream> using namespace std; int main() { int a,counter=0,b; cin>>a; for(int i=1; i<=a; i++) { b=i; if(i%4==0||i%7==0)counter++; while(b){ if(b%10==4&&(b/10)%10==4){ counter++; break; } if(b%10==7&&(b/10)%10==7){ counter++; break; } b/=10; } } cout<<counter; return 0; }