小明年齡15歲,身高162cm,體重82.5kg,是否屬于肥胖兒童,的編碼是這樣寫嗎?
#?include?(stadio.h);???int??main(??);???{???????int??age=15;???????print("%d","15");???????int??height=162cm;???????print("%d","162cm");???????float??weight=82.5kg;???????print("%f",weight);???????return??0;????}
2020-05-10
代碼寫錯了,大概意思有了,還缺一句“是肥胖兒童"
stadio,改為stdio
print,改為printf
#include <stdio.h>? 頭文件后面不寫分號
int? main()主函數(shù)后面不寫分號
int、float跟數(shù)字
2020-05-03
你可以這樣寫:
#include <stdio.h>
int main()
{
int age=15;
int height=162;
float weight=82.5;
//char cm,Kg;
printf("小明年齡%d歲\n",age);
printf("身高%dcm\n",height);
printf("體重%fKg\n",weight);
printf("是否屬于肥胖兒童:yes!\n");
return 0;
}
2020-04-11
#include <stdio.h>
? int? main(? )??
? {? ? ? ?
? int? age=15;? ? ??
? printf("%d \n",age);? ? ? ?
? int? height=162;? ? ??
? printf("%d \n",height);? ? ?
? float? weight=82.5;? ? ? ?
? printf("%f",weight);??
? return? 0;?
??
? }