mirror of
https://github.com/Aexiar/c.git
synced 2024-10-22 14:05:45 +02:00
c
This commit is contained in:
parent
5ddeb3b277
commit
69d7472e28
@ -1019,6 +1019,8 @@ int main() {
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
// 禁用 stdout 缓冲区
|
||||
setbuf(stdout, NULL);
|
||||
|
||||
// 使用整型来表示真和假两种状态
|
||||
int handsome = 0;
|
||||
@ -1052,6 +1054,8 @@ int main() {
|
||||
#define FALSE 0
|
||||
|
||||
int main() {
|
||||
// 禁用 stdout 缓冲区
|
||||
setbuf(stdout, NULL);
|
||||
|
||||
BOOL handsome = 0;
|
||||
printf("帅不帅[FALSE 丑,TRUE 帅]: ");
|
||||
@ -1078,12 +1082,17 @@ int main() {
|
||||
```c
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
int main() {
|
||||
// 禁用 stdout 缓冲区
|
||||
setbuf(stdout, NULL);
|
||||
|
||||
int temp; // 使用 int 类型的变量临时存储输入
|
||||
_Bool handsome = 0;
|
||||
printf("帅不帅[0 丑,1 帅]: ");
|
||||
scanf("%d", &handsome);
|
||||
scanf("%d", &temp);
|
||||
|
||||
// 将输入值转换为 _Bool 类型
|
||||
handsome = (temp != 0);
|
||||
|
||||
if (handsome) {
|
||||
printf("你真的很帅!!!");
|
||||
|
Loading…
Reference in New Issue
Block a user