这有什么不对,为什么它不会将所有数字加在一起并显示出来 [英] Whats wrong with this why does it not add all the numbers together and display them

查看:41
本文介绍了这有什么不对,为什么它不会将所有数字加在一起并显示出来的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里缺少什么?

what am i missing here?

展开 | 选择 | Wrap | 行号

推荐答案

确定以后的问题你应该在解释问题的帖子中包含更多文字,标题应该是摘要。我知道提出问题页面不清楚。


您的问题是您的商家信息的第38行
OK for future questions you should include more text in the post explaining the problem and the title should be a summary. I am aware that the "Ask a Question" page does not make this clear.

You problem is line 38 of your listing
add>> number1 + number2 + number3 + number4 + number5;
add >> number1 + number2 + number3 + number4 + number5;

这是一个有效的数值表达式,因此它编译(返回add的值,右移所有数字变量的总和)。


您需要使用赋值运算符(=)来指定要添加的所有数字变量的总和。

This is a valid numerical expression so it compiles (return the value of add shifted right by the sum of all the number variables).

You need to use the assignment operator (=) to assign the sum of all the number variables to add.


顺便说一下,您期望第17-21行做什么? ?这些行将逻辑表达式的结果分配给这些变量。逻辑表达式只能有0或1的值。
By the way, what do you expect lines 17-21 to do? These lines assign the result of a logical expression to those variables. Logical expressions can only have the values 0 or 1.


是的我认为所有的一切都谢谢你,至于程序的其余部分我需要为结果分配一个字母等级平均水平。我通过添加const int进行必要的更改A = 1 B = 2 C = 3 D = 4 F = 5

其他整数已被删除,我需要放置变量A = 90 + B = 80> 90℃= 70> 80 D = 60> 70且F => 60这将是这样,我不确定插入它的公式。应该是if语句还是其他什么?谢谢你的帮助
yes i figured that all out thank you and as for the rest of the program I need to assign a letter grade to the outcome of the average grade. I made necessary changes by adding const int of A = 1 B=2 C=3 D=4 F=5
the other ints have been removed and I need to place the variable of A=90+ B=80>90 C=70>80 D=60>70 and F=>60 where would this go and I am not sure of the formula to insert it. Should it be with a if statement or something else? Thanks for you help


这篇关于这有什么不对,为什么它不会将所有数字加在一起并显示出来的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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