展开全部
#include <iostream>
using namespace std;
void fun(int bianchang, int *mianji, int *zhouchang)
{
*mianji = bainchang*bianchang;
*zhouchang = bainchang*4;
}
int main()
{
int bianchang,mianji,zhouchang;
cin>>bianchang;
fun(bianchang,&mianji,&zhouchang);
cout << mianji << zhouchang<<endl;
}
using namespace std;
void fun(int bianchang, int *mianji, int *zhouchang)
{
*mianji = bainchang*bianchang;
*zhouchang = bainchang*4;
}
int main()
{
int bianchang,mianji,zhouchang;
cin>>bianchang;
fun(bianchang,&mianji,&zhouchang);
cout << mianji << zhouchang<<endl;
}
追答
#include
using namespace std;
void fun(int bianchang, int *mianji, int *zhouchang)
{
*mianji = bianchang*bianchang;
*zhouchang = bianchang*4;
}
int main()
{
int bianchang,mianji,zhouchang;
cin>>bianchang;
fun(bianchang,&mianji,&zhouchang);
cout << mianji << " "<< zhouchang<<endl;
}
isn@ubuntu:~/offer$ g++ test.c
isn@ubuntu:~/offer$ ./a.out
5
25 20
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询