93c16edb5a
- 修正主README.md中的所有路径引用,使其与当前文件结构一致 - 更新翁凯C语言学习指南链接路径 - 更新五子棋AI项目文档链接路径 - 更新数据结构学习文档链接路径 - 修正编译说明和学习模块使用指南中的目录路径 - 改进五子棋README.md的编译运行说明,增加Windows和Linux/macOS的分平台指导 - 确保所有文档链接和路径引用都能正确工作
23 lines
529 B
C
23 lines
529 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <time.h>
|
|
#include <math.h>
|
|
#include <stdbool.h>
|
|
|
|
int main()
|
|
{
|
|
// !#include <stdbool.h>之后,bool类型就可用,即true和false
|
|
// 逻辑运算符:&&(与)、||(或)、!(非)
|
|
// 逻辑运算符的优先级低于关系运算符,高于算术运算符
|
|
// 逻辑运算符的运算对象和求值结果都是bool类型
|
|
// 逻辑运算符的运算对象可以是任意能转换成bool类型的值
|
|
|
|
bool b = 6 > 5; // b为true
|
|
bool t = true;
|
|
t = 2;
|
|
printf("%d\n", t); // bool类型只能以%d输出,即结果为1
|
|
|
|
return 0;
|
|
}
|
|
|