提交时间:2026-01-04 15:00:53

运行 ID: 80115

#include <iostream> using namespace std; int main() { int n; cin >> n; int count = 0; // 满足条件的数的个数 for (int i = 0; i < n; i++) { int num; cin >> num; // 分离各位数字 int thousand = num / 1000; // 千位 int hundred = (num / 100) % 10; // 百位 int ten = (num / 10) % 10; // 十位 int unit = num % 10; // 个位 // 判断条件:个位 - 千位 - 百位 - 十位 > 0 if (unit - thousand - hundred - ten > 0) { count++; } } cout << count << endl; return 0; }