c++菜鸟来大神帮编一个int pow程序!
从键盘输入五个数,求五个数的平方,并输出。要求:
1.使用cin cout输入输出
2.编写求平方的函数,函数原型为 int pow(x)
3.调用函数求得输入的五个数的平方
2016-11-27 18:02
2016-11-27 18:17
2016-11-27 18:21
程序代码:int pow(int x)
{
int y = 2;
int cnt = 1;
while (y--)
{
cnt = cnt * x;
}
return cnt;
}

2016-11-27 18:34

2016-11-27 18:58

2016-11-27 21:41