| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 837 人关注过本帖
标题:照书上敲的......结果...
取消只看楼主 加入收藏
浅水无殇
Rank: 2
等 级:论坛游民
帖 子:123
专家分:75
注 册:2012-11-23
结帖率:100%
收藏
 问题点数:0 回复次数:1 
照书上敲的......结果...
#include<iostream>
using namespace std;
template <typename T>;
T max(T a,T b,T c)
{
    if(b>a) a=b;
if(c>a) a=c;
return a;

}
int main()
{int i1=8,i2=5,i3=6,i;
double d1=56.9,d2=90.765,d3=43.1,d;
long g1=678984,g2=-1245,g3=-45461,g;
i=max(i1,i2,i3);
d=max(d1,d2,d3);
g=max(g1,g2,g3);
cout << "i_max="<<i<<endl;
cout <<"f_max="<<f<<endl;
cout <<"g_max=""<<G<<endl;


    return 0;
}
C:\Documents and Settings\4-2\xxm.cpp(4) : error C2059: syntax error : '<end Parse>'
C:\Documents and Settings\4-2\xxm.cpp(7) : error C2143: syntax error : missing ';' before '{'
C:\Documents and Settings\4-2\xxm.cpp(7) : error C2447: missing function header (old-style formal list?)
C:\Documents and Settings\4-2\xxm.cpp(16) : error C2065: 'i' : undeclared identifier
C:\Documents and Settings\4-2\xxm.cpp(16) : error C2065: 'max' : undeclared identifier
C:\Documents and Settings\4-2\xxm.cpp(17) : error C2065: 'd' : undeclared identifier
C:\Documents and Settings\4-2\xxm.cpp(18) : error C2065: 'g' : undeclared identifier
C:\Documents and Settings\4-2\xxm.cpp(19) : fatal error C1903: unable to recover from previous error(s); stopping compilation
Error executing cl.exe.

xxm.obj - 8 error(s), 0 warning(s)

搜索更多相关主题的帖子: max Documents include double 
2013-03-13 15:10
浅水无殇
Rank: 2
等 级:论坛游民
帖 子:123
专家分:75
注 册:2012-11-23
收藏
得分:0 
cout <<"g_max=""<<G<<endl;

.....抱歉....

wula wual
2013-03-13 15:13
快速回复:照书上敲的......结果...
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.025590 second(s), 8 queries.
Copyright©2004-2025, BC-CN.NET, All Rights Reserved