Home > Back-end >  The great spirit guide, why not run my code
The great spirit guide, why not run my code

Time:09-21


# include "Header. H"
#include//clear screen header file
#include//c + + header file
#include//the string header file
Using namespace STD.

Int main ()
{
String ID, key;//into the procedures required for password
Cout<& lt;" Pleace enter your username: ";//administrator name
for(int i=0; I<3; I++)
{
cin> ID;
If (ID!="admin")
{
Cout<& lt;" ID can 't be found!" Cout<& lt;" Pleace enter your username: ";
If (I==2) exit (0);//three times error out
}
else break;
}

Cout<& lt;" Pleace enter your password: ";//administrator password
for(i=0; I<3; I++)
{
cin> The key;
If (key!="admin")
{
Cout<& lt;" The key is wrong!" Cout<& lt;" Pleace enter your password: ";
If (I==2) exit (0);//three times error out
}
else break;
}

Readdate ();//-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- read
Hello ();//the welcome screen

Cout<& lt;" Press any key to return "& lt; system("pause");

return 0;
}
Prompt error C2143: syntax error: missing '; 'before'} '
An error occurred when performing cl. Exe.

CodePudding user response:

missing '; 'before'} '
Missing a semicolon

CodePudding user response:

The error C2676: binary '! Class=':' STD: : basic_string & lt; Char, struct STD: : char_traits & lt; Char> Class, STD: : allocator 'does not define this operator or a conversion to a typ
E is acceptable to the predefined operator
An error occurred when executing cl. Exe.

5. Obj - 1 error (s), and 0



Most initially said is not available in c + +, the string is added. H has become such a...

CodePudding user response:

Input password, three times the judgment errors out of the end of the semicolon, into a half Angle of a try?

CodePudding user response:

 # include "Header. H" 
#include//clear screen header file
#include//c + + header file

//c + + & lt; String> And C & lt; String. H> Are not the same, good check the difference between the two header file
#include

using namespace std;

Int main ()
{
String ID, key;//into the procedures required for password
Cout<& lt;" Pleace enter your username: ";//administrator name
for(int i=0; I<3; I++)
{
cin> ID;
If (ID!="admin")
{
Cout<& lt;" ID can 't be found!" Cout<& lt;" Pleace enter your username: ";
If (I==2) exit (0);//three times error out
}
else break;
}

Cout<& lt;" Pleace enter your password: ";//administrator password
for(int i=0; I<3; I++)
{
cin> The key;
If (key!="admin")
{
Cout<& lt;" The key is wrong!" Cout<& lt;" Pleace enter your password: ";

//you have a problem the semicolon here, remember, all symbols to switch to the English input method to input
If (I==2) exit (0);//three times error out
}
else break;
}

Readdate ();//-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- read
Hello ();//the welcome screen

Cout<& lt;" Press any key to return "& lt; system("pause");

return 0;
}
  • Related