如何使用带参数的函数 [英] how to use function with parameters

查看:118
本文介绍了如何使用带参数的函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

编写一个程序,输入矩形的长度和宽度。

然后计算并显示矩形的面积和周长。使用函数与参数

write a program that will enter the length and width of the rectangle.
then compute and display the area and perimeter of the rectangle. use function with parameter

推荐答案

您应该阅读 C ++ 函数的教程,例如,请参阅: cplusplus.com上功能(I) [ ^ ]。
You should really read a tutorial on C++ functions, see, for instance this: "Functions (I)" at cplusplus.com[^].


对于C ++新手(和你一样),我推荐他们观看以下视频教程系列(非常短的视频),然后购买C ++并阅读。

http://thenewboston.org/list.php?cat=16 [ ^ ]



关于您的问题的答案将在第10个教程中介绍:

http://thenewboston.org/watch.php?cat=16&number=10 [ ^ ]
For C++ newbies (like you), I recommend them to watch the following video tutorial series (very-short videos) and then buy a C++ and read.
http://thenewboston.org/list.php?cat=16[^]

The answer regarding your question is covered in the 10th tutorial:
http://thenewboston.org/watch.php?cat=16&number=10[^]


这篇关于如何使用带参数的函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆