mirror of
https://github.com/wczffl-503/OI-Codes.git
synced 2025-07-08 02:13:51 +08:00
归类了 OJ,整理了一下
This commit is contained in:
27
XSM OJ 重庆小码王集团OJ/统计满足条件的4位数.cpp
Normal file
27
XSM OJ 重庆小码王集团OJ/统计满足条件的4位数.cpp
Normal file
@ -0,0 +1,27 @@
|
||||
#include <iostream>
|
||||
#include <cstring>
|
||||
#include <cstdio>
|
||||
#include <iomanip>
|
||||
using namespace std;
|
||||
int main(){
|
||||
int a[10000],b,c,d,e,f,g=0;
|
||||
scanf("%d",&b);
|
||||
for(int i=0;i<b;i++){
|
||||
cin >>a[i];
|
||||
}
|
||||
for(int i=0;i<b;i++){
|
||||
c=a[i]%10;
|
||||
a[i]/=10;
|
||||
d=a[i]%10;
|
||||
a[i]/=10;
|
||||
e=a[i]%10;
|
||||
a[i]/=10;
|
||||
f=a[i]%10;
|
||||
a[i]/=10;
|
||||
if((c-d-e-f)>0){
|
||||
g++;
|
||||
}
|
||||
}
|
||||
printf("%d",g);
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user