c ++脚本帮助 [英] c++ script help
问题描述
推荐答案
您遇到了什么问题?你收到错误信息吗?请更多信息。
What problems are you having? are you getting an error message.? A little more information please.
不,我只是不理解脚本。 Plz帮助
#
return1; //这是否意味着如果此语句失败则重新启动if语句
第28行
第32-34行
#
中位数=大小%2 == 0? (作业[中] +作业[mid-1] / 2
#
:作业[mid];
#
//不是作业[mid] =作业作业[size / 2]这是多少个数字
和第37行
<< ; 0.2 +中期+ 0.4 *最终+ 0.4 *中位数//不是中位数=大小%2
no i just don''t understand the script. Plz help
#
return1; // does that mean if this statement fail it restart the if statement
line 28
line 32-34
#
median=size %2 ==0 ? (homework[mid]+homework[mid-1] /2
#
:homework[mid];
#
//isn''t homework[mid]= to homework homework[size/2] which is how many numbers
and line 37
<<0.2+midterm+0.4 *final+0.4*median//isn''t median =size%2
不,我只是不要不理解脚本.Plz帮助
return1; //这是否意味着如果此语句失败则重启if语句
no i just don''t understand the script. Plz help
return1; // does that mean if this statement fail it restart the if statement
否不。我的意思是如果没有输入家庭作业,请停止程序。返回将突破主程序。基本上关闭程序。
no no. I means that if no homeworks were inputed, stop the program. The return will break out of main. Basically shutting down your program.
median = size%2 == 0?(作业[mid] +作业[mid-1] / 2
:作业[mid];
median=size %2 ==0 ? (homework[mid]+homework[mid-1] /2
:homework[mid];
要取中位数,你需要找到中间测试。但是,如果有一定数量的测试,哪一个是中间。这是一个可视的例子:
1 2 3 4 5<中位数是3
1 2 3 4<中位数是(2 + 3)/ 2
这会检查大小,如果大小是偶数,请先做命令(在问号和冒号之间),如果没有,做什么是结肠后。基本上它是一个布尔if语句。
希望有所帮助。
To take the median, you need to find the middle test. However, if there is an even number of tests, which one is the middle. Here''s a visual example:
1 2 3 4 5 < the median is 3
1 2 3 4 < the median is (2 + 3)/2
This checks the size, if the size is even, do first command (between question mark and colon), if not, do what is after the colon. Basically it is a boolean if statement.
Hope that helped.
这篇关于c ++脚本帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!