当前位置:网站首页>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
边栏推荐
- Chinese output of PostGIS console is garbled
- Datasets dataset class (2)
- Sharing ideas for a quick switch to an underlying implementation
- Mark: unity3d cannot select resources in the inspector, that is, project locking
- (improved) bubble sorting and (improved) cocktail sorting
- 一个快速切换一个底层实现的思路分享
- Experience sharing of mathematical modeling: comparison between China and USA / reference for topic selection / common skills
- 国信证券的排名如何?办理股票开户安全吗?
- 大学生值得珍藏的实用网站推荐
- Pychar remotely connects to the server to run code
猜你喜欢
PostGIS create spatial database
How to call self written functions in MATLAB
View触摸分析
Naacl2022: (code practice) good visual guidance promotes better feature extraction, multimodal named entity recognition (with source code download)
使用宝塔面板部署flask环境
Sword finger offer 40.41 Sort (medium)
【 Native cloud】 Éditeur ivx Programmable par tout le monde
Electron
Mark一下 Unity3d在Inspector中选中不了资源即Project锁定问题
Server create virtual environment run code
随机推荐
大学生值得珍藏的实用网站推荐
Deploy the flask environment using the pagoda panel
详解C语言编程题:任意三条边能否构成三角形,输出该三角形面积并判断其类型
权威发布 | 延安大学2022年教师岗位招聘公告
人的顶级能量从哪里获取?
【async/await】--异步编程最终解决方案
Stream常用操作以及原理探索
Use abp Zero builds a third-party login module (II): server development
SwiftUI找回丢失的列表视图(List)动画
GDAL and opencv smooth and blur TIF images
Atcoder bit operation & Conclusion + formula derivation
datasets Dataset类(2)
Oracle11g database import and export method tutorial [easy to understand]
Sectigo的IP证书申请流程
Numpy基本使用
Sword finger offer 05.58 Ⅱ string
STM32F1和GD32F1有什么区别?
Common evaluation indexes of classification model -- confusion matrix and ROC curve
Sword finger offer 40.41 Sort (medium)
From Celsius to the three arrows: encrypting the domino of the ten billion giants, and drying up the epic liquidity