【发布时间】:2023-02-04 17:27:01
【问题描述】:
所以我是 CodeBlocks 的新手。我想知道我是否可以在输入全部内容后让 CodeBlocks 输出我的代码?因为我的 CodeBlocks 总是显示我输入的每一行的输出,所以有点烦人。对不起,我的英语不好。如果您感到困惑,请检查我提供的图片,谢谢。
The number is my input, but CodeBlocks always show the 'YES' or 'NO'after i input a number of lines I want the output to be like this。
无论如何,这是我用来制作该输出的代码。
#include <stdio.h>
int main(void) {
int t, a, b, c;
scanf("%d", &t);
for (int i = 0; i < t; i++) {
scanf("%d %d %d", &a, &b, &c);
if (a + b == c || b + c == a || a + c == b) {
printf("YES\n");
}
else {
printf("NO\n");
}
}
return 0;
}
我尝试在 YouTube 和谷歌上搜索任何可能的网站,但仍未找到任何解决方案
【问题讨论】:
-
我会在指向
char的指针数组中用fgets读取整行,然后用sscanf解析它们。
标签: c codeblocks