gpt4 book ai didi

无法找到一种方法在 c 中的 not 运算符中实现它

转载 作者:行者123 更新时间:2023-11-30 20:42:11 25 4
gpt4 key购买 nike

#include <stdlib.h>
#include <stdio.h>

int main()
{

const int minAge = 16;
const int maxAge = 18;
int age = 0;

printf("how ols ru?");
scanf("%d", &age);

if (!age>=minAge || age <= maxAge)
strong text
{
printf("no phone for u");
}

return 0;

}

我需要为年龄不在 16-18 岁之间的人提供一部手机,我该如何使用!运算符?

最佳答案

if (!(年龄 < minAge || 年龄 > maxAge))

关于无法找到一种方法在 c 中的 not 运算符中实现它,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53212287/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com