Home > Back-end >  Adding machine
Adding machine

Time:11-26

# include
using namespace std;
Int main ()
{
int a,b,c;
char q;
Q='+'.
Cin & gt;> A> Q> b;
C==a + b;
cout Cin. The get ();
return 0;
}

CodePudding user response:

C==a + b???????
C=a + b, isn't it

CodePudding user response:

This program has a problem

CodePudding user response:

this program has a problem

CodePudding user response:

In front of the
Q='+' in fact it is not necessary to
If I lose is 1 to 2 it will still be output 3

CodePudding user response:

Input @ @

CodePudding user response:

Q='+' in fact it is not necessary to
Cin & gt;> A. & gt;> B & gt;> Endl;
C=a + b;
cout CodePudding user response:

refer to the original poster Li Zi become response:
# include
using namespace std;
Int main ()
{
int a,b,c;
char q;
Q='+'.
Cin & gt;> A> Q> b;
C==a + b;
cout Cin. The get ();
return 0;
}

There is a problem,
And the problem is very serious,
It felt as if the original poster idea is not clear,
It feels a bit like doing not understand it ourselves,
First of all,
What good is a definition of q? You end up not a or a + b, there is no relationship with q,
Second, the==is equal to the operator, not the assignment operator,
Is the assignment operator=
Help you the modified code is as follows:
 
# include
using namespace std;
Int main ()
{
int a,b,c;
Cin> A> b;
C=a + b;
Coutreturn 0;
}

CodePudding user response:

 # include 
using namespace std;

Int main () {
int a,b,c;
char q;
Cin> A> Q> b;
C=a + b;
Coutreturn 0;
}
  • Related