true false

 1 #include<stdio.h>
 2 
 3 int main(void)
 4 {
 5     /*
 6         true    1
 7         false    0
 8     */
 9 
10     printf("%d\n", 5 == 3);
11     printf("%d\n", 5 > 3);
12     printf("%d\n", 5 <= 3);
13 
14     return 0;
15 }

 

 1 #include<stdio.h>
 2 #include<stdbool.h>  //定义布尔量时使用
 3 
 4 int main(void)
 5 {
 6     bool b = 6 > 5;
 7 
 8     bool t = true;
 9     t = 2;
10 
11     printf("%d\n", b);
12     printf("%d\n", t);
13 
14     return 0;
15 }

posted @ 2019-11-01 14:12  jason2018  阅读(227)  评论(0编辑  收藏  举报