可计算加减乘除,还可以输出
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#define term1 ' '
#define format 1
using namespace std;
typedef long long ll;
typedef long double ld;
class compute {
private:
double answer;
public:
void __init__(short n) { answer = n; }
void __init__(int n) { answer = n; }
void __init__(ll n) { answer = n; }
void __init__(float n) { answer = n; }
void __init__(double n) { answer = n; }
void __init__(ld n) { answer = n; }
void num_add(short n) { answer += n; }
void num_add(int n) { answer += n; }
void num_add(ll n) { answer += n; }
void num_add(float n) { answer += n; }
void num_add(double n) { answer += n; }
void num_add(ld n) { answer += n; }
void num_sub(short n) { answer -= n; }
void num_sub(int n) { answer -= n; }
void num_sub(ll n) { answer -= n; }
void num_sub(float n) { answer -= n; }
void num_sub(double n) { answer -= n; }
void num_sub(ld n) { answer -= n; }
void num_tim(short n) { answer *= n; }
void num_tim(int n) { answer *= n; }
void num_tim(ll n) { answer *= n; }
void num_tim(float n) { answer *= n; }
void num_tim(double n) { answer *= n; }
void num_tim(ld n) { answer *= n; }
void num_exc(short n) { answer /= n; }
void num_exc(int n) { answer /= n; }
void num_exc(ll n) { answer /= n; }
void num_exc(float n) { answer /= n; }
void num_exc(double n) { answer /= n; }
void num_exc(ld n) { answer /= n; }
auto pr() { return answer; }
};
class PRINT {
public:
void print(short n) { printf("%d%c", n, term1); }
void print(int n) { printf("%d%c", n, term1); }
void print(ll n) { printf("%lld%c", n, term1); }
void print(float n) {
if (format == 0) printf("%f%c", n, term1);
else {
cout.setf(ios::fixed);
cout << setprecision(format) << n << term1;
}
resetiosflags(ios::fixed);
}
void print(double n) {
if (format == 0) printf("%lf%c", n, term1);
else {
cout.setf(ios::fixed);
cout << setprecision(format) << n << term1;
}
resetiosflags(ios::fixed);
}
void print(ld n) {
if (format == 0) printf("%Lf%c", n, term1);
else {
cout.setf(ios::fixed);
cout << setprecision(format) << n << term1;
}
resetiosflags(ios::fixed);
}
void print(char ch) { printf("%c%c", ch,term1); }
void print(char ch[]) { printf("%s%c", ch, term1); }
void print(string str) { printf("%s%c", str.c_str(), term1); }
};
int main() {
PRINT print;
compute com;
return 0;
}