C++初学者,出现了以下的错误,求大神带我飞
1#include<iostream>2usingnamespacestd;3intmain()4{doublea,b,sum5cout<<"请输入两个数:";6cin>...
1#include<iostream>
2using namespace std;
3int main()
4{ double a,b, sum
5 cout<<"请输入两个数:";
6 cin>>a>>b;
7 sum=a+b;
8 cout<<a<<"a+b"<<"="<<sum<<endl;
9}
5 5 D:\C++文件\加法运算.cpp [Error] expected initializer before 'cout'
7 5 D:\C++文件\加法运算.cpp [Error] 'sum' was not declared in this scope 展开
2using namespace std;
3int main()
4{ double a,b, sum
5 cout<<"请输入两个数:";
6 cin>>a>>b;
7 sum=a+b;
8 cout<<a<<"a+b"<<"="<<sum<<endl;
9}
5 5 D:\C++文件\加法运算.cpp [Error] expected initializer before 'cout'
7 5 D:\C++文件\加法运算.cpp [Error] 'sum' was not declared in this scope 展开
3个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询