c語言程式 二次 三次 四次方的計算
#include
#include
int main(void)
{
int x,a,b,c;
int square(int);
int cube(int);
int power4(int);
printf("input x=");
scanf("%d",&x);
a=square(x);
b=cube(x);
c=power4(x);
printf("the square of %d=%d\n",x,a);
printf("the cube of %d=%d\n",x,b);
printf("the power4 of %d=%d\n",x,c);
system ("pause");
return 0;
}
int square(int n)
{
return n*n;
}
int cube(int n)
{
return n*n*n;
}
int power4(int n)
{
return n*n*n*n;
}
Today's Visitors: 0 Total Visitors: 37
Personal Category: c語言程式
Topic: learning / education / linguistic
Previous in This Category: c語言程式 圓的周長,體積,表面積 和 圓柱,圓錐的體積,表面積 Next in This Category: c程式語言 停車場費率
Previous in This Category: c語言程式 圓的周長,體積,表面積 和 圓柱,圓錐的體積,表面積 Next in This Category: c程式語言 停車場費率










1樓
1樓搶頭香
3Q..