当前位置:网站首页>Notes on writing questions in C language -- table tennis competition
Notes on writing questions in C language -- table tennis competition
2022-06-26 14:48:00 【Fanyi】

List of articles
subject
Two ping-pong teams play , Three people each . Team a is for a,b,c Three people , Team B is x,y,z Three people , Draw lots to decide the competition list .
Someone asked the players for the list of the game .a Say he's not at peace x Than ,c Say he's not at peace x,z Than , Please program to find out the players of the three teams .
Ideas
Loop through , And use conditional statements to exclude one by one .
Answer key
#include <stdio.h>
int main()
{
char i,j,k; // i yes a The opponent ,j yes b The opponent ,k yes c The opponent
for(i='x';i<='z';i++)
{
for(j='x';j<='z';j++)
{
if(i!=j)
for(k='x';k<='z';k++)
{
if(i!=k&&j!=k)
{
if(i!='x'&&k!='x'&&k!='z')
{
printf(" The list is :a--%c\tb--%c\tc--%c\n",i,j,k);
}
}
}
}
}
}
Sample output


边栏推荐
- idea快捷键
- MySQL master-slave replication and read-write separation
- Naacl2022: (code practice) good visual guidance promotes better feature extraction, multimodal named entity recognition (with source code download)
- 备战数学建模30-回归分析2
- D - Face Produces Unhappiness
- '教练,我想打篮球!' —— 给做系统的同学们准备的 AI 学习系列小册
- 权威发布 | 延安大学2022年教师岗位招聘公告
- 'coach, I want to play basketball!'—— AI Learning Series booklet for system students
- Online bull Blogger
- 大学生值得珍藏的实用网站推荐
猜你喜欢

【 Native cloud】 Éditeur ivx Programmable par tout le monde

聊聊 RPA 方向的规划:简单有价值的事情长期坚持做

Server create virtual environment run code

Electron

备战数学建模30-回归分析2

Electron

Sword finger offer 05.58 Ⅱ string

This is the graceful file system mounting method, which is effective through personal testing
![[solo π] ADB connects multiple mobile phones](/img/44/4bd88725434fb67c9237645f024071.png)
[solo π] ADB connects multiple mobile phones

Sword finger offer 15.65.56 I 56Ⅱ. Bit operation (simple - medium)
随机推荐
【soloπ】adb连接单个多个手机
Is it safe to open an online stock account? Somebody give me an answer
Transformers datacollatorwithpadding class
Introduction to basic knowledge of C language (Daquan) [suggestions collection]
信息学奥赛一本通 1400:统计单词数 (字符串匹配)
Correlation of XOR / and
[solo π] ADB connects multiple mobile phones
挖财注册开户安全吗,有没有什么风险?
Combat readiness mathematical modeling 31 data interpolation and curve fitting 3
券商经理给的开户链接办理股票开户安全吗?我想开个户
获取两个dataframe的交并差集
Equation derivation: second order active bandpass filter design! (download: Tutorial + schematic + Video + code)
【云原生】 ”人人皆可“ 编程的无代码 iVX 编辑器
Complete diagram / Euler loop
Sword finger offer 05.58 Ⅱ string
登录认证服务
赠书 | 《认知控制》:我们的大脑如何完成任务?
【async/await】--异步编程最终解决方案
oracle11g数据库导入导出方法教程[通俗易懂]
Common evaluation indexes of classification model -- confusion matrix and ROC curve