當前位置:首頁 » 編程語言 » c語言for格式

c語言for格式

發布時間: 2022-03-06 15:37:34

『壹』 C語言for的用法

#include <stdio.h>
#include <math.h>
int main(void)
{
int repeat, ri;
double x, y;

scanf("%d", &repeat);
for(ri = 1; ri <= repeat; ri++){
scanf("%lf",&x);

if(x>=0){
y=sqrt(x);//這個已經開方了
}
else{
y=pow(x+1,2)+2*x+1/x;
}
printf("f(%.2f) = %.2f\n", x, y);

}
return 0;
}

熱點內容
硬碟緩存128m 發布:2025-09-18 01:15:13 瀏覽:752
蘋果手機設備密碼是指什麼 發布:2025-09-18 01:02:26 瀏覽:466
asp門戶網站源碼 發布:2025-09-18 00:54:00 瀏覽:448
java資料庫例子 發布:2025-09-18 00:53:58 瀏覽:219
sh腳本輸出 發布:2025-09-18 00:48:10 瀏覽:257
我的世界伺服器箱里的東西沒了 發布:2025-09-18 00:39:20 瀏覽:934
java數字轉大寫 發布:2025-09-18 00:25:58 瀏覽:312
網路編程百度雲 發布:2025-09-18 00:19:52 瀏覽:125
安卓手機供電在哪裡 發布:2025-09-18 00:08:38 瀏覽:394
Linux調度器 發布:2025-09-18 00:01:50 瀏覽:276