当前位置:网站首页>寻找真凶
寻找真凶
2022-07-26 22:38:00 【沉梦昂志浮生若梦】
c语言凶手查找
日本某地发生了一件谋杀案,四位嫌疑人有三人说的是真话 请判断真凶
A:不是我
B:是C
C:是D
D:C在胡说
注意点 int 和char,char 实际上是以ascii码可以用%d输出 int数据也可以用%c输出 对应的是相应的字符;
利用只有三个人说的真话加上for循环来达到目的
#include <stdio.h>
int main()
{
int killer = 0;
for (killer = 'a'; killer <= 'd'; killer++)
if ((killer != 'a') + (killer == 'c') + (killer == 'd') + (killer != 'd') == 3)
printf("killer is %c", killer);
return 0;
}
边栏推荐
- Signal and system impulse response and step response
- Anaconda => PyCharm => CUDA => cudnn => PyTorch 环境配置
- [Qt]元对象系统
- Codeforces C1. Simple Polygon Embedding
- 查看 Anaconda 创建环境的位置
- Configure deeplobcut2 with your head covered
- 12_决策树(Decision tree)
- Codeforces D. Buying Shovels
- 生成yolov5.wts文件出错
- Drawing warehouse-2 (function image)
猜你喜欢

deeplabcut使用1

Matlab simulation of image reconstruction using filtered back projection method

AutoCAD的卸载后重新安装,删除注册表的详细过程

Leetcode - hash table

Configure deeplobcut2 with your head covered

RESNET paper interpretation and code implementation (pytorch)

2022_ SummerBlog_ 008
![[Qt]属性](/img/ca/5f9d8f33e38b0ac5cbb0768a7b3ffd.png)
[Qt]属性

Request attribute in crawler

Openharmony quick start
随机推荐
Error generating yolov5.wts file
知识蒸馏——pytorch实现
Drawing warehouse Tsai
爬虫解析网页的find方法
Drawing warehouse-3 (functional image)
Chapter 7 course summary
[Qt]属性
Training team lpoj round10 d come minion!
Signal and system impulse response and step response
放图仓库-Tsai
Codeforces E. maximum subsequence value (greed + pigeon nest principle)
01 knapsack problem 416. Segmentation and equal sum subset -494. Goal and
Blue Bridge Cup brush question notes (word analysis)
PTA 7-3 lists leaf nodes
机器人学台大林教授课程笔记
爬虫解析网页的 对象.元素名方法
LeetCode题目——二叉树篇
uni-app学习(二)
Codeforces D. two divisors (number theory, linear sieve)
Mysql database complex operations: Database Constraints, query / connect table operations