Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
104204 陈家渝 12满足条件的四位数 C++ Accepted 1 MS 272 KB 498 2025-01-04 15:41:11

Tests(10/10):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int n,i,s=0,a,q,b,sh,g; cin>>n; for(i=1;i<=n;i++) { cin>>a; q=a/1000; b=a/100%10; sh=a/10%10; g=a%10; if(g-b-q-sh>0) s++; } cout<<s; return 0; }