Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
113934 王奕杰 12满足条件的四位数 C++ Accepted 1 MS 272 KB 475 2025-03-17 19:38:33

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,x,g,s,b,p,sum=0; cin>>n; for(int i=1;i<=n;i++){ cin>>x; g=x%10; s=x%100/10; b=x%1000/100; p=x/1000; if(g-s-b-p>0){ sum++; } } cout<<sum; return 0; }