請(qǐng)問我這怎么錯(cuò)了?????
#include <stdio.h>
int main()
{
??? //定義小編兜里的錢
??? double money =12????? ;
??? //定義打車回家的費(fèi)用
??? double cost =11.5?????? ;?
??? printf("小編能不能打車回家呢:");
??? //輸出y小編就打車回家了,輸出n小編就不能打車回家
??? printf( "%f\n",money>=cost?'y':'n' );
??? return 0;
}
2017-03-16
?printf( "%f\n",money>=cost?'y':'n' );%f類型為浮點(diǎn),而題目要求為輸出%c單個(gè)字符,請(qǐng)復(fù)習(xí)第二章數(shù)據(jù)類型內(nèi)容。
2017-03-12
不能是%f,%f是浮點(diǎn)