The New Year has been delayed for a lot of time. I haven't sat down to study seriously for a long time. The new year is almost over, and I have to start to study officially. It took me one day to learn by video, I learned simple variables and their related input, output, and applications, and learned several basic types:
Int (integer) char (numeric) string (string type) double (double-precision floating point number) decimal (currency value type) float (floating point number ).
In the Main method, repeated variable declaration is not allowed, but repeated values can be assigned. After repeated values are assigned, the original variable value is replaced with the newly assigned value.
1. in C #, "+" has two meanings;
1. Bind a value symbol. When either side of the plus or minus sign is a character or string type, use "+" to connect the data between the two sides.
2. the plus sign in mathematics is involved in the calculation of complex data, indicating the addition operation in mathematics.
The value assignment operator = (not the equal sign in mathematics) is the lowest calculation level in C # And is executed at the end.
2. placeholders
First {0}
Second {1}
Third {2}
.......
Example: Console. WriteLine ("name {0} gender {1} age {2}", name, sex, age );
Main(= age = = ; pay = Console.WriteLine(, name, age, pay);+name,+age+); Console.WriteLine( + name, + age + ); a = ; b = +
Main( name = Tel = sex = age =
Main( Pho = type = money = weight = ; Console.WriteLine(
Console. ReadLine (); used to receive user input data. You need to define a string variable to store user variables.
String input;
Input = Console. ReadLine ();
Equivalent to string input = Console. ReadLine ();
Main( Console.WriteLine( input =
3. Exchange variable values
To exchange the values of two variables, you must use the third variable.
Int a = 5, B = 10;
Int c;
C = B;
B =;
A = c;
Console. WriteLine ("a = {0} B = {1}", a, B );
Console. ReadKey ();
Main( a = b = ===,b,a);
I wrote so much, wrote a blog review, and summarized my study today. It is quite practical. All of a sudden, this kind of feeling is already a master in this field. I just got started. I think there is a series of news about it. It's really a matter of time. There's no other way, just come on.