8.5 修改乱码—-2015.01.20 #include
<pre code_snippet_id=”285699” snippet_file_name=”blog_20140410_1_8715504” name=”code” class=”cpp”>#include
using namespace std;
template
AnyType max5(AnyType arr[5])
{
//AnyType max=0;
<pre code_snippet_id=”285699” snippet_file_name=”blog_20140410_1_8715504” name=”code” class=”cpp”>AnyType max=arr[0];//这里应该是arr[0]
for(int i=0;i<5;i++){if(arr[i]>max)max=arr[i];}return max;};void main85(){int a[5]={10,20,50,6,33};double b[5]={5.2,3.5,6.7,8.8,4};cout<<”the amax is “<<max5(a)<<endl;cout<<”the bmax is “<<max5(b)<<endl;system(“pause”);}
—————————————————————————————————————————————————— //写的错误或者不好的地方请多多指导,可以在下面留言或者给我发邮件,指出我的错误以及不足,以便我修改,更好的分享给大家,谢谢。 转载请注明出处:https://www.royalchen.com/ author:royalchen Email:royalchen@royalchen.com ———————————————————————————————————————————————————
- 本文作者: royalchen
- 本文链接: http://www.royalchen.com/2016/02/24/cprimerplus第六版课后编程题答案85/
- 版权声明: 本博客所有文章除特别声明外,均采用 MIT 许可协议。转载请注明出处!