#include "pch.h"
#include <iostream>
using namespace std;
void a(double a, double b, double *add) {
*add = a + b;
}
void j(double a, double b, double *jian) {
*jian = a - b;
}
void m(double a, double b, double *cheng) {
*cheng = a * b;
}
void c(double a, double b, double *chu) {
*chu = a / (float)b;
}
int main()
{
double *s1 = NULL;
int d;
cin >> d;
if (d == 0) { a(12, 4, s1); cout << s1; }
else if (d == 1) { j(12, 4, s1); cout << s1; }
else if (d == 2){m(12, 4, s1); cout << s1; }
else if (d == 3) { c(12, 4, s1); cout << s1; }
else cout << "输入错误值";
}
如题
麻烦大家解决一下,最好能把程序