Brush question some of the details ready

introduction

Immediately ready to re-examination, the need to test the machine, just in time for pneumonia at home, then brush this time with the title bar. Currently it intends to order "algorithm Notes" brushing title, so do some preparatory work.

C/C++

Basic data types

  1. I did not intend to clear the entire multi know the number of bits on it. int type is a 10-digit 2 at the beginning of. That is, if the said title data 10 . 9 or less, or a 32-bit integer int are used on the line. long long int is 19, if the 10 18 is less, may be long long int types. If there is another big calculation data, the basic data types do not need large numbers simulation.
  2. A ASCII code is 65, a 97 ASCII code is, in fact, just remember that capital letters plus 32 lowercase letters.
    3. Boolean type can be used directly in C ++, but not in the C language, you need to add boolstd.h header files can.
  3. If you want to print%, you need to enter %%
  4. Output format to sort through the words:% md m bits is to force right-aligned. When controlling the output format can be used. If you still need to make up in front of zero, then you can use% 0md control.
  5. getchar and putchar two functions can be used to input and output a single character.
  6. typedef complex data types to be renamed typedef Long Long LL;after such renaming, LL use it.
  7. For file reading operations, scanf to read the document, read failure returns -1, not zero. The C language EOF (End Of File) is -1, so use EOF to detect whether the file read end.
while(scanf("%d",&n) != EOF){
	//这样也就是到达文件末尾,结束while循环。
	...
}

string.h header file

  1. strlen () function
    strlen function that returns the length of the array of characters.
  2. strcmp () function
    strcmp comparison result for two strings.
  3. strcpy () function
    strcmp (an array of characters, character array 2), the character array to copy character array 2 1.
  4. strcat () function
    strcat (an array of characters, character array 2), spliced to the array of characters after the character array 2 1.
Released two original articles · won praise 0 · Views 21

Guess you like

Origin blog.csdn.net/qq_30377869/article/details/104196489