- 统计满足条件的4位数
死循环
- 2024-11-13 19:40:15 @
using namespace std;
int main()
{
int a, b, x=0;
cin >> a;
for(int i = 1; i <= a; i ++)
{
int c, d, e, f;
cin >> b;
c = b % 10;
d = b / 1000;
e = (b / 100) % 10;
f = (b % 100) / 10;
if(c-d-e-f > 0) x++;
}
cout << x;
return 0;
}
1 comments
-
BlueCat LV 2 @ 2024-11-13 20:04:07
@高2027届姚栋程 (ydc0708#) 你头文件呢?
- 1
Information
- ID
- 577
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 3
- Tags
- (None)
- # Submissions
- 187
- Accepted
- 103
- Uploaded By