天天看點

c語言錯誤E0167,E0167"int" 類型的實參與 "const char *" 類型的形參不相容 什麼問題怎麼解決...

按你的程式作了必要的幾處修改:

#include 

#include 

#define Pi 3.1415927

int main()

{

double Input,ra,f;

printf("Please input your number to calcution what you want\n\n1.Ball's Volume\n2.Surface Area of The Ball\n\n");

scanf("%lf", &Input);

if (Input == 1)

{

printf(" \n\n\nV=(4/3)Pi*r^3\nPlease input 'r'\n");

scanf("%lf",&ra);

f = (4 * Pi * ra * ra * ra / 3);

printf("%lf",f);

getch();

}

return 0;

}

程式能夠運作了:

c語言錯誤E0167,E0167"int" 類型的實參與 "const char *" 類型的形參不相容 什麼問題怎麼解決...

但是你的 2.Surface Area of The Ball 程式還未加入。