怎么办?用户输入一些数字,然后另一个函数返回这些数字相加的结果? (C/C++)
怎么办?用户输入一些数字,然后另一个函数返回这些数字相加的结果? (C/C++)
例如,用户输入 3 4 7,然后他会在屏幕 14 上看到打印内容 另一位,用户输入 5 6 并得到 11
我是 C 编程初学者,所以我请你帮助我,请
how to do? User type some numbers and then another function return result of addition of these numbers? (C/C++)
for example, user type in 3 4 7 and then he see printed on screen 14
another one, user type 5 6 and gets 11
I'm a beginner in programming C, so I ask you to help me, please
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在高层次上:
这很简单,无需实际发布代码,我不会这样做,因为我怀疑这是这样的家庭作业。
At a high level:
This is as simple as it can get without actually posting code, which I won't do as I suspect this is a homework assignment.
因为参数的数量没有指定,我认为你需要 va_list 但正如你所说,你是 C++ 新手,所以你可以这样写
because the number of arguments is not specified i think you need va_list but as you said you are new in c++ so you can write it like this