第八行有問題
這個系統顯示是正確的,但是第8行的“%f%c”不應該是這樣的嗎,"%f,%c"
#include <stdio.h>
int main()
{
? ? int age = 18;
float height = 1.85;
char unit = 'm';
printf("小明今年%d歲\n", age);
printf("小明身高%f%c\n", height, unit);
printf("小明現在在慕課網上學習IT技術");?
return 0;
}
這個系統顯示是正確的,但是第8行的“%f%c”不應該是這樣的嗎,"%f,%c"
#include <stdio.h>
int main()
{
? ? int age = 18;
float height = 1.85;
char unit = 'm';
printf("小明今年%d歲\n", age);
printf("小明身高%f%c\n", height, unit);
printf("小明現在在慕課網上學習IT技術");?
return 0;
}
2022-08-21
舉報
2022-12-04
如果要輸出多個變量的并指定變量的位置時候,格式符還可以連用,變量之間需要用逗號隔開,如:
2022-08-23