#include <iostream>
using namespace std;
int main( )
{
double a,b,c,s;
a = 3;
b = 4;
c = 5;
s = 1/2 * (a+b+c);
cout<<"s="<<s<<endl;
return 0;
}
------解决方案--------------------------------------------------------
1/2==0
------解决方案--------------------------------------------------------
#include <iostream>
using namespace std;
int main( )
{
double a,b,c,s;
a = 3;
b = 4;
c = 5;
s = 1.0/2 * (a+b+c);
cout<<"s="<<s<<endl;
return 0;
}