Input statement:
Console.ReadLine (); --Read keyboard keys
Console.readkey (); --Read input content
Output statement:
Console.WriteLine (writes the string to be output); --Automatic line wrapping
Console.Write (writes the string to be output); --No automatic line wrapping
Three ways to annotate://Comment one line
/**/comment section
Put it on a function and annotate a function.
Data type:
Base data type (value type)
int integer in-memory integer
Double decimal type Save decimal Example: 2.13
char character type storage character example: ' A '
BOOL Boolean type in existence State True&false
DateTime Date Time Type Save date Time Example: 2015-07-01
Complex types (reference types)
String String type
Value types can store data values directly;
The reference type stores an address, reads the address first, and then reads the data that the address points to
Note: Kanji are strings and cannot be converted to int characters
String does not perform mathematical operations
Concatenation between strings with a + representation
Type conversions:
1. Auto-convert (implicit)
Convert.to type name (number to turn);---commonly used in this way
Type name. Parse (number to turn);
(type name) variable: a type of the same large class can be converted with ()
Definition of variable constants:
Type variable name, for example: int A;
Const type constant name, such as const double t = 3.14;
Operator:
1. Arithmetic operator: +-*/% + +--
2. Relational operators: = =! = > < >= <=
3. Logical operator:&& | | !
4. Other operators: + = = *=/=%=?:
15-07-01 C # language Basics