Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
39652 | lihaocheng | 统计满足条件的4位数 | C++ | Accepted | 0 MS | 256 KB | 325 | 2024-02-03 15:16:26 |
#include<iostream> #include<cstdio> using namespace std; int main(){ int a,b,c,d,e,n,sum=0; scanf("%d",&n); for(int i=1;i<=n;i++){ scanf("%d",&a); b=a%10; c=a%100/10; d=(a%1000)/100; e=a/1000; if((b-c-d-e)>0) sum=sum+1; } printf("%d",sum); return 0; }