Home > Net >  Enter debug exit?
Enter debug exit?

Time:11-06

 
namespace ConsoleApp20
{
Class Program
{
The static void Main (string [] args)

{
The Console. Write (" please enter the age: ");
String strAge=Console. ReadLine ();
Int the age=the Convert. ToInt32 (strAge);
If (age & gt; 18) {
Console. WriteLine (" can view ");
}
Else if (the age & lt; 10)
{
Console. WriteLine (" are not allowed to view ");
}
The else {
//in front of the two conditions to rule out
The Console. Write (" whether to continue review (yes, no)?" );
String isContinue=Console. ReadLine ();
If (isContinue=="yes")
{
Console. WriteLine (" continue to view ");
}
Else if (isContinue=="no")
{
Console. WriteLine (" don't continue to see ");
}
The else
{
Console. WriteLine (" input error!" );
}
}

}
}
}
Excuse me, what's the matter? Request to guide, thank you.

CodePudding user response:

The Main function to run over, that's not dropped out, with a code execution steps, think again,

CodePudding user response:

Run out without directly exit to direct execution, not debugging, finally add a Console. Either ReadKey () waiting for input
  •  Tags:  
  • C #
  • Related