找不出哪有問題,求解
#include <stadio.h>
int main()
{? ?int a = 1;
? ? ? ? ?b = 2;
? ? ? ? ?c = 3;
? ? double result;
? ? result = a + b* c
? ? printf("%f",result);
? ? return 0;
? ??
}
hello.c:1:20:?fatal?error:?stadio.h:?No?such?file?or?directory ?#include? ????????????????????^ compilation?terminated.
2020-10-27
1、這里提示你:stadio這個(gè)單詞寫錯(cuò)了,是stdio? 。
2、?int a,b,c ; //你沒有事先聲明。
2、result = a + b* c //后面要有個(gè)分號(hào)“;”結(jié)尾。
3、printf("%f",result); //標(biāo)準(zhǔn)點(diǎn)是printf("%f\n", result);你的缺少了"\n"回車換行符,當(dāng)然,不要也可以運(yùn)行。
---------改正如下----------你的答案是7,先乘除,后加減,2*3=6? ?, 6+1=7
#include <stdio.h>
int main()
{
? ? int a,b,c;
? ? double result;
? ? a = 1;
? ? b = 2;
? ? c = 3;
? ? result = a + b * c ;? ? //在這里體驗(yàn)哦~
? ? printf("%f\n", result);
? ? return 0;
}
2020-10-21
int a=1那行要在大括號(hào)下一行才能正常運(yùn)行