請問 我這個哪里錯了 他說我輸出錯誤 謝謝解答
#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("小明現(xiàn)在在慕課網(wǎng)上學習IT技術");?
return 0;
}
#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("小明現(xiàn)在在慕課網(wǎng)上學習IT技術");?
return 0;
}
2019-07-14
舉報
2019-07-14
%f和%c之間的逗號去掉就不會輸出錯誤了?,你加了逗號輸出結果就變成1.850000,m ?,他要的是1.850000m
2019-07-14
原來如此 謝謝啦 我沒看他要求?
2019-07-14
printf("小明身高%f%c\n", height, unit),去掉%f和%c之間的逗號。?
2019-07-14
printf("小明身高%f%c\n", height, unit)
不用逗號