标题:此源程序错在什么地方
取消只看楼主
unsigend
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2010-5-17
结帖率:0
已结贴  问题点数:20 回复次数:0 
此源程序错在什么地方
#include<iostream>
void main()
{
 int i(1),sum(0);
 while(i<=10)
(
 sum+=i;
 i++;
 )
cout<<"sum="<<sum<<endl;
}
下面是编绎出错信息
------------Configuration: Cpp3 - Win32 Debug--------------------
Compiling...
Cpp3.cpp
f:\vcycx\cpp3.cpp(7) : error C2143: syntax error : missing ')' before ';'
f:\vcycx\cpp3.cpp(9) : error C2059: syntax error : ')'
f:\vcycx\cpp3.cpp(10) : error C2065: 'cout' : undeclared identifier
f:\vcycx\cpp3.cpp(10) : error C2297: '<<' : illegal, right operand has type 'char [5]'
f:\vcycx\cpp3.cpp(10) : error C2065: 'endl' : undeclared identifier
执行 cl.exe 时出错.

Cpp3.exe - 1 error(s), 0 warning(s)
搜索更多相关主题的帖子: include before 源程序 信息 
2010-05-17 17:06



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-307038-1-1.html




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

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