1樓:汐日南莘
#include
#include
void main()
float x,y;
printf("請輸入x: \n");
scanf("%f",&x);
printf("輸入x=: %f\n",x);
if(x<0)
y=5-x;
else if(x==0)//是等於號 就這一個問題y=0;
else if(x>0&&x<10)
y=sqrt(2*x)-1;
else
y=3*x-11;
printf("y=%f\n",y);
2樓:龍__鳳
x和0相等,是這樣比較的x==0,你的是x=0是賦值,把這個改了就可以了
3樓:
把第一個else刪除最後一個else改if (x大於10)
原因你的條件語句邏輯錯誤
4樓:匿名使用者
#include
#include
int main(void)
else if (x == 0) else if (x>0&& x<10) else
printf("y=%f\n", y);
return 0;}
C語言連結串列的問題,高手來看看我怎麼就錯了
見下面 中的註釋 include include struct node int s 0 void main struct node creat struct node head printf 請再輸入一個數 p struct node malloc sizeof struct node scanf...
如何用微控制器C語言計算呼叫子函式的時間
用定時器 include clock t begin 開始記錄時間。begin time 你要測試時間的程式。begin time begin 獲得測試程式執行的時間。printf ld begin clocks per sec 按照s,秒為單位輸出時間。include clock t begin ...
用C語言迭代函式的呼叫來計算X X 3 3 X 5 5 X
昂元亮 1 輝三角形 要求列印出10行 include main printf 1 n 求一個3 3的矩陣對角線元素之合 直接用兩個for迴圈遍歷矩陣 然後用if判斷在i j的時候把該元素加到sum裡面 3 什麼迭代求法,有什麼規則。距離用法 例如3次函式 迭代演算法是用計算機解決問題的一種基本方法...