C language Statements

Source: Internet
Author: User

/*console.write ("Can you run over the leopard, please input can/cannot:");
String a = Console.ReadLine ();//receives the input string content,
if (a== "can")
{

Console.Write ("You are more animals than animals");
}
else if (a = = "cannot")
{
Console.Write ("You don't even have an animal");
}
else//must execute if none of the conditions are met
Console.Write ("You entered the error");

Console.ReadLine (); */

Conversion of intermediate variables

/*console.write ("Please enter a number a=");
int a = Int. Parse (Console.ReadLine ());
Console.Write ("Please enter a number b=");
int b = Int. Parse (Console.ReadLine ());
Console.Write ("Please enter a number c=");
int C=int. Parse (Console.ReadLine ());

if (a >b)
{
int Zhong;
Zhong = A;
A = b;
b = Zhong;
}


if (a>c)
{
int Zhong;
Zhong=a;
A=c;
C=zhong;
}


if (b>c)
{
int Zhong;
Zhong=b;
B=c;
C=zhong;
}

Console.Write (A + "," +b+ "," +c ");
Console.ReadLine (); */

Nesting method

/*console.write ("Please enter an integer within 100:");
int a = Int. Parse (Console.ReadLine ());
if (a <= 100)//First determine the number of inputs is less than or equal to 100
{
if (a < 10)//Exclude parts less than 10
{
Console.WriteLine ("The number you have entered is less than 10");
}

The rest of else//is the 10--100 part.
{
if (a = = 100)//Exclude 100
{
Console.WriteLine ("The number you have entered is 100");
}
The rest of else//is the 10--100 part.
{
Console.WriteLine ("The number you have entered is a two-digit number");
}
}
}
Console.ReadLine (); */


/*console.write ("Please enter Name:");
String name = Console.ReadLine ();
Console.Write ("Please enter test results:");
Double a=double. Parse (Console.ReadLine ());//score will have fractional parts
if (a<=100 && a>0)
{
Console.Write ("Congratulations" +name+ "full score through");
}
if (a<100 && a>=80)
{
Console.Write ("+name+" is excellent, continue to maintain ");
}
if (a>=60 && a<80)
{
Console.Write ("+name+" good grades ");
}
if (a > && a < 60)
{
Console.Write ("+ name +" Just a little bit, keep trying ");
}
Else
{
if (A < 50)
{
Console.Write ("+name+" Are you a pig?);
}
if (a > 100)
{
Console.Write ("You entered the error");
}
}
Console.ReadLine (); */

C language Statements

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.