可输入1145141919810以及它的字串,可求得恶臭等式;
欢迎来到化粪池
#include<bits/stdc++.h>
using namespace std;
void zero(){
cout<<"(1-1)*4514";
}
void positive(int num){
int cnt=0;
map<int,string>m;
m[1]="11/(45-1)*4";
m[2]="-11+4-5+14";
m[3]="11*(-4)+51-4";
m[4]="-11-4+5+14";
m[5]="11-4*5+14";
m[6]="1-14+5+14";
m[7]="11-4+5-1-4";
m[8]="11-4+5/1-4";
m[9]="11-4+5+1-4";
m[10]="-11/4+51/4";
while (num>0){
cnt++;
int ys=num%10;
if (ys==0){
num/=10;
continue;
}
else{
cout<<"("<<m[ys]<<")";
for (int i=1;i<=cnt-1;i++){
cout<<"*("<<m[10]<<")";
}
}
if (num>10) cout<<"+";
num/=10;
}
}
void negative(int num){
cout<<"(11/(45-1)*4)*(11-4-5+1-4)*(";
num=abs(num);
int cnt=0;
map<int,string>m;
m[1]="11/(45-1)*4";
m[2]="-11+4-5+14";
m[3]="11*(-4)+51-4";
m[4]="-11-4+5+14";
m[5]="11-4*5+14";
m[6]="1-14+5+14";
m[7]="11-4+5-1-4";
m[8]="11-4+5/1-4";
m[9]="11-4+5+1-4";
m[10]="-11/4+51/4";
while (num>0){
cnt++;
int ys=num%10;
if (ys==0){
num/=10;
continue;
}
else{
cout<<"("<<m[ys]<<")";
for (int i=1;i<=cnt-1;i++){
cout<<"*("<<m[10]<<")";
}
}
if (num>10) cout<<"+";
num/=10;
}
cout<<")";
}
void zhengshu(int zs){
if (zs>0){
positive(zs);
}
else if (zs<0){
negative(zs);
}
else{
zero();
}
}
int main(){
int n;
cin>>n;
cout<<n<<"=";
zhengshu(n);
return 0;
}