C語言萌新,求大佬指教,c語言小萌新求助大佬

2021-03-04 05:37:09 字數 1043 閱讀 2437

1樓:匿名使用者

試試scanf_s();

c++出於安全性考慮用scanf_s函式。

c語言小萌新求助大佬

2樓:聽不清啊

float輸入輸出應使用格式符%f而不是%lf#define pi 3.14

#include

#include

float yuan(float);

float zheng(float,float);

float san(float,float);

int text(double);

int main()

}while(!text(r));

s=yuan(r);

break;

case 2:

printf("請輸入矩形的長和寬 ");do}while(!text(chang)||!text(kuan));

s=zheng(chang,kuan);

break;

case 3:

printf("請輸入三角形的底和高 ");do}while(!text(di)||!text(gao));

s=san(di,gao);

break;

}printf("%f",s);

return 0;

}float yuan(float r)

float zheng(float chang,float kuan)

float san(float di ,float gao)int text(double a)

萌新看不懂**的執行結果,求大佬指教。

3樓:哈西

程式從main函式開始執行,執行到f=s(40,50)+e語句時,

s(40,50)代表上面定義的int s(const int b,int c)的函式,也就相當於把40傳給b,50傳給c,然後返回a+b+c+d,也就是10+40+50+20=120,然後再加上e,就是120+30=150

請求c語言的大佬幫幫萌新,請求c語言的大佬幫幫萌新?

d,f不能亂用的,要對應好整型和浮點 求c語言的大佬幫幫萌新?int t,i,j 一個語句結束要以分號結尾 萌新求教c語言大佬們,為什麼這個執行不了?語法上好像也沒啥錯誤,邏輯上有點毛病。主要在內層for 迴圈上。很明顯版 整型line2陣列沒有賦權初值,陣列元素為隨機值。而你的迴圈體line2 a...

c語言求指教,C語言求指教

你的if 1,1,pig 的意義何在?你要想罵人豬直接printf pig 啊!如果pig是個變數,你要申請變數啊!c語言,求指教?main a p1 m 因為p1 m,所以p1 m的值為假,即a 0 b p1 p2 7 b 4 6 7 0 7 7 所以,答案是0和7。c語言誕生於美國的貝爾實驗室,...

c語言問題,求大佬幫忙,c語言問題,求大佬幫忙

include stdafx.h include define sever type 3 define oil type 4 int oil type int serve type double all price struct oil char type double price struct s...