当前位置:网站首页>Who is the winner of PTA
Who is the winner of PTA
2022-07-06 02:54:00 【weCream】
answer :
#include<stdio.h>
int main(){
int n,m,i,j,k,l,t;
scanf("%d%d",&n,&m);
int a[3],num=0;
for(i=0;i<3;i++)
scanf("%d",&a[i]);
int flag=0;
if(n>m){
for(i=0;i<3;i++){
if(a[i]==0)
num++;
}
if(num!=0){
printf("The winner is a: %d + %d",n,num);
}
else printf("The winner is b: %d + 3",m);
}
else{
for(i=0;i<3;i++){
if(a[i]==1)
num++;
}
if(num!=0){
printf("The winner is b: %d + %d",m,num);
}
else printf("The winner is a: %d + 3",n);
}
}
Limited ability , The code is not concise enough , I hope the boss will criticize and correct me .
边栏推荐
- [matlab] access of variables and files
- My C language learning records (blue bridge) -- files and file input and output
- 【Kubernetes 系列】一文學會Kubernetes Service安全的暴露應用
- Déduisez la question d'aujourd'hui - 729. Mon emploi du temps I
- Li Kou today's question -729 My schedule I
- 力扣今日題-729. 我的日程安排錶 I
- MySQL winter vacation self-study 2022 11 (8)
- Introduction to robotframework (II) app startup of appui automation
- "Hands on learning in depth" Chapter 2 - preparatory knowledge_ 2.5 automatic differentiation_ Learning thinking and exercise answers
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 10
猜你喜欢
My C language learning record (blue bridge) -- under the pointer
Introduction to robotframework (II) app startup of appui automation
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 13
PMP practice once a day | don't get lost in the exam -7.5
Apt installation ZABBIX
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 24
故障分析 | MySQL 耗尽主机内存一例分析
Introduction to robotframework (I) brief introduction and use
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 7
【Kubernetes 系列】一文學會Kubernetes Service安全的暴露應用
随机推荐
【若依(ruoyi)】ztree 自定义图标(iconSkin 属性)
PMP每日一练 | 考试不迷路-7.5
The difference between sizeof and strlen in C language
微服务间通信
MySQL advanced notes
Software design principles
纯Qt版中国象棋:实现双人对战、人机对战及网络对战
Which ecology is better, such as Mi family, graffiti, hilink, zhiting, etc? Analysis of five mainstream smart brands
[matlab] access of variables and files
CobaltStrike-4.4-K8修改版安装使用教程
GifCam v7.0 极简GIF动画录制工具中文单文件版
Briefly describe the implementation principle of redis cluster
【 kubernets series】 a Literature Study on the Safe exposure Applications of kubernets Service
07 singleton mode
Introduction to robotframework (III) Baidu search of webui automation
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 7
Fault analysis | analysis of an example of MySQL running out of host memory
C # create self host webservice
Yyds dry inventory comparison of several database storage engines
Detailed use of dbutils # yyds dry goods inventory #