# include & lt; Cmath>
using namespace std;
Char value [100].
Int output_valuetable (int x)
{
Int I, j, t;
For (I=x; I> 0; I -)
{
Cout<" \ t "& lt; <" P "& lt; }
Cout<" \ t "& lt; <" T/F "& lt;
{
Cout<" \ t ";
T=I;
for(j=0; J
If (t % 2==0)
{
Cout<" F "& lt; <" \ t ";
} the else
{
Cout<" T "& lt; <" \ t ";
}
T/t=2;
}
Cout
}
Int output_zhq (int x)
{
Int I, j, k;
for(i=0; I<(int) pow (2 * 1.0 x); I++)
{
K=I;
If (value [I]=='F')
{
Cout<" (";
For (j=x; j> 0; J -)
{
If (k % 2==0)
{
If (j==1)
{
Cout<" P "& lt;
{cout<" P "& lt;
{
If (j==1)
{
Cout<" ~ P "& lt;
{cout<" ~ P "& lt;
K=k/2;
}
Cout<" ) ";
Cout<" ^ ";
}
}
}
Int output_zxq (int x)
{
Int I, j, k;
for(i=0; I<(int) pow (2 * 1.0 x); I++)
{
K=I;
If (value [I]=='T')
{
Cout<" (";
For (j=x; j> 0; J -)
{
If (k % 2==0)
{
If (j==1)
{
Cout<" ~ P "& lt;
{cout<" ~ P "& lt;
{
If (j==1)
{
Cout<" P "& lt;
{cout<" P "& lt;
K=k/2;
}
Cout<" ) ";
Cout<" V ";
}
}
}
Int main ()
{
Int I, n;
//char a, [100].
Cout<" Please enter the number argument: "& lt;
Cout<" Please enter the expression of true value: "& lt;
{
Cin> The value [I];
}
Cout<" True value table is as follows: "& lt;
Cout<" \ n ";
Cout<" The main conjunctive normal form is as follows: "& lt;
Cout<" \ n ";
Cout<" The main disjunctive normal form is as follows: "& lt;
Cout
}
After the operation is always more output a ^ or V,
Why use cout<" B \ "; Does not delete the last character;
CodePudding user response:
Use string record the answer, and then delete redundant in string behind