读书人

新手求教c++解决办法

发布时间: 2012-03-24 14:00:46 作者: rapoo

新手求教c++
#include<iostream>
using namespace std;
int main ()
{
int a;
a=2*3+-3%5-4/3;
float b;
b=5+3.2e-5.6/0.03;
cout<<a<<"\t"<<b<<endl;
int m=3,n=4;
a=m++-(--n);
cout<<a<<"\t"<<m<<"\t"<<n<<endl;
}


调试结果:

1.cpp(8) : warning C4305: '=' : truncation from 'const double' to 'float'
1.cpp(8) : error C2143: syntax error : missing ';' before 'constant'
1.cpp(13) : warning C4508: 'main' : function should return a value; 'void' return type assumed
Error executing cl.exe.
求教

[解决办法]
b=5+3.2e-5.6/0.03;
e-5.6 //这个什么东西
你想表达的意思是什么?

读书人网 >C++

热点推荐