code tips

Common header files

math
iomanip
algorithm
fstream

Common file inputs (summarized earlier)
define input streams

ifstream fin;
fin.open("filename.txt");
int x;
fin>>x;

Summary of c/c++ output format
Set the field width setw ()
Set the precision after the decimal point setprecision() Automatically fill
0 after the digit ,cmp) cmp needs to be written by yourself Rewrite the function to change the parameter type abs can be rewritten as the return value of double type





Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326315862&siteId=291194637