【不用break退出循环】2022-1-25
缘由jzoj9248: 幸运数-数据结构与算法-CSDN问答
_int64 n=0;bool p=1;
cin>>n;
while(n)if(n%10==7||n%10==4)n/=10;else n=p=0;
//while(p)if(n%10==7||n%10==4)n/=10;else p=0;
cout<<p<<endl;
缘由jzoj9248: 幸运数-数据结构与算法-CSDN问答
_int64 n=0;bool p=1;
cin>>n;
while(n)if(n%10==7||n%10==4)n/=10;else n=p=0;
//while(p)if(n%10==7||n%10==4)n/=10;else p=0;
cout<<p<<endl;