One: Input function:
1:
String a = Console.ReadLine (); Place the input string into the variable A;
2:
int a = Console.read (); The ASC code of the first character of the input string is stored in the shaping variable A;
Two: Line break (execution on the next line): Console.WriteLine ();
Input: int a = 9;
Console.WriteLine ();
Console.WriteLine ();
Console.WriteLine (a);
Three: Formatted output
A: Enter:
int a = 1;int b = 2;int c = 3;
Console.WriteLine ("A={0},b={1},c={2}", a,b,c);
Output:
B: Enter:
FLOAT score = 23.5f;
f indicates a few digits after the decimal point and can be appended with numbers
Console.WriteLine ("Score={0:f2}", score);
Console.WriteLine ("score={0:0.000}", score);
Output:
C: Input
Convert the data to a% form and keep two decimal bit Console. WriteLine ("{0:p2}", 1/4f); If the string is preceded by @, the escape character inside the string fails the Console. Write (@ "lanoukeji\n"); Console. Write ("Hello World");
C # Notes (ii)--input and output functions