|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
就是我看的教材,課後作業有這道題(圖1)
所以我就把這串代碼打出來
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- int a1 = 456 ;
- int a2 = 654 ;
- int a3 = 456 ;
-
- boolean bc1 = (a1 > a2) ;
- boolean bc2 = (a2 < a3) ;
- boolean bc3 = (a3 == a1) ;
-
- printf("%d\n", bc1 ) ;
- printf("%d\n", bc2 ) ;
- printf("%d\n", bc3 ) ;
-
- return 0 ;
- }
复制代码
會報錯無法執行(圖2)
我在想這個boolean應該是代表布林型態?
叫不出來是不是因為前面的#include沒含括到?
但目前的教學內容中,打出#include的時候
都只有出現<stdio.h>和<stdlib.h>,還沒有出現別的...
本帖最后由 傻眼貓咪 于 2021-12-26 21:36 编辑
_Bool
- #include <stdio.h>
- // #include <stdlib.h>
- int main()
- {
- int a1 = 456 ;
- int a2 = 654 ;
- int a3 = 456 ;
-
- _Bool bc1 = (a1 > a2);
- _Bool bc2 = (a2 < a3);
- _Bool bc3 = (a3 == a1);
-
- printf("%d\n", bc1);
- printf("%d\n", bc2);
- printf("%d\n", bc3);
-
- return 0 ;
- }
复制代码
|
|