#include <iostream>
#include <cstdio>
using namespace std;
int main(void)
{
int n = 0;//n个数
cin >> n;
int a = 0;//保存个位
int b = 0;//保存十位
int c = 0;//保存百位
int d = 0;//保存千位
int count = 0;//四位数
int ans = 0;//减去后的结果
int sum = 0;//保存个数
for (int i = 1; i <= n; ++i)
{
cin >> count;//输入
a = count % 10;
b = count % 100 / 10;
c = (count % 1000) / 100;//别问我为什么,写就对了(我也不知道)
d = count / 1000;
ans = a - b - c - d;
if (ans > 0)
{
sum += 1;
}
}
cout << sum << endl;//hhh,写完了
return 0;
}
1077:统计满足条件的4位数
最新推荐文章于 2024-01-04 14:44:05 发布