欢迎光临散文网 会员登陆 & 注册

1077:统计满足条件的4位数-信息学奥赛一本通

2023-07-31 09:42 作者:机房吃鸡  | 我要投稿

#include<algorithm>

#include<cmath>

#include<cstdio>

#include<iostream>



using namespace std;


int main(){

int n,tot=0;

cin>>n;

for(int i=1;i<=n;i++){

string s;

cin>>s;

int thousand=s[0]-'0';

int hundred=s[1]-'0';

int ten=s[2]-'0';

int one=s[3]-'0';

if(one-thousand-hundred-ten>0){

tot++;

}

}

cout<<tot;


return 0;

}


1077:统计满足条件的4位数-信息学奥赛一本通的评论 (共 条)

分享到微博请遵守国家法律