你如何让返回类型作为这个表达式的双精度返回:a = 2 * NUM + z;
?
这是我的完整程序:
#include <iostream>
using namespace std;
int main()
{
const int NUM = 10;
const double x = 20.5;
int a, b;
double z;
char grade;
a = 25;
cout <<"a = " <<a <<endl;
cout <<" Enter two integers : ";
cin >> a >> b;
cout << endl;
cout << " The numbers you entered are "
<<a <<" and " <<b <<endl;
z = x + 2 * a - b;
cout <<"z = " <<z <<endl;
grade = 'A';
cout <<"Your grade is " <<grade <<endl;
a = 2 * NUM + z;
cout << "The value of a = " << a <<endl;
return 0;
}