Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
109098 | 6张轶涵 | 不吉利的数 | C++ | Wrong Answer | 1 MS | 268 KB | 369 | 2025-01-26 17:08:24 |
#include<bits/stdc++.h> using namespace std; int pd(int n) { while(n>=1) { int h=n%10; if(h==4) { return 1; } if(h==2&&n%100==4) { return 1; } n/=10; } return 0; } int main() { int n,m; cin>>n>>m; int s=0; for(int i=n;i<m;i++) { bool f=pd(i); if(f==0) { s++; } } cout<<s<<endl; return 0; }
------Input------
4 500
------Answer-----
317
------Your output-----
320