Programming: find a solution in case of a problem
The C language program can directly perform addition, subtraction, multiplication, division, and division of four arithmetic operations. The four arithmetic symbols are + -*/)
A semicolon is used to end a complete task. We call it a statement.
Each Complete operation step must end with a semicolon .;
Each content ended with a semicolon is called a statement;
Use {} to group statements;
Multi-Level Grouping nested braces
All top-level braces ({}) must have their own names. The names of the two top-level braces must be different.
The name is written in front of the top-level braces. The name can start at will. Main rules: if there is only one top-level braces, its name must be main.
You must have at least one top-level braces.
The parentheses before the braces must be written. --- Used to pass Parameters
Return Value of the ashes function of a person's life --- all top-level braces can be left with a number or left blank. Use
Return value;
The C language supports multiple keywords. return is a keyword that can be used to specify legacy numbers. Return has two functions: 1. It is used to specify the remaining number.
In C language programs, numbers are grouped. Each group is called a data type. Numbers in different groups cannot be mixed.
All numbers must be clearly specified. By default, they are considered to be all numbers without decimal places in int type programs. By default, they belong to the integer type.
The data to be used in the braces must be declared outside the braces intmain () {1000-400; return0 ;}
Each data type is named in C language, and int is the name of the integer type.
Only one statement can be written in one row for troubleshooting.
The content should be aligned when it is expanded by the same braces. Indentation must be performed between different braces.
Intmain (){
1000-400;
Return0;
} -------------------------------> Writing specifications
If gcc File Name translation is complete, nothing is successful.
./Write a. out strictly.
Note // a movie ticket of 30 yuan calculates the price of three movie tickets
In C language programs, you can use annotations to record text information.
A single line comment starts with a slash (//). All subsequent content is treated as text information, and only one line of content is affected.
/*
Multi-line comments are ignored no matter how much content is written.
1. Author: syt
2. Date: 2013.09.24
3. Version 1.0
The left side of the value assignment operator must be a variable. The right side of the value assignment operator is anything that can be used as a number.
Variables can be used directly as numbers in a program.
Only assigning values to variables changes the content of variables.
Multiple variables of the same type can be declared using one statement.
The variable name can represent both variables and numbers. The specific function is determined by the environment.
If no value is assigned to a variable, the integer value is: unpredictable -------------. When declaring a variable, the value is assigned to the variable to clear the number in the storage location.
There must be numbers at any time for any storage.
The variable must be initialized and assigned immediately when the variable is declared)
Variables can be used to indicate numbers that are completely unknown during programming. --- Equivalent to an unknown number in Mathematics
A variable can also be used to represent a set of regular numbers. Once used up, the variable is no longer used.
In the process of using variables, the change rules are written in the program, instead of assigning values to the calculated values.
2yy6p
Print 1361015
This article from the "Know what it does not" blog, please be sure to keep this source http://shenyantao.blog.51cto.com/1957956/1303265