ios_base::sync_with_stdio(false);//这个函数是一个“是否兼容stdio”的开关
cin.tie(0);//解除cin与cout的绑定
//cf 有毒,能用long long 就用long long
//规定 sizeof(int)<=sizeof(long int )<=sizeof(long long int )
#include<iostream>
using namespace std;
int main(){
cout<<sizeof(long long int )<<endl;
cout<<sizeof(long int )<<endl;
return 0;
}
//output
//8
//4
long int a=1;
a<<=63;
long int a = 1L<<63;
有效,只有加了L下标的才认为是long int 数,其他默认是int 数。
计算log,用换底公式
log
Compute natural logarithm (function )
log10
Compute common logarithm (function )
--------
char * fgets ( char * str, int num, FILE * stream );
istream& getline (char* s, streamsize n );
istream& getline (char* s, streamsize n, char delim );
A newline character makes fgets stop reading, but it is considered a valid character by the function and included in the string copied to str. fgets有
The delimiting character is the newline character ('\n') for the first form, and delim for the second: when found in the input sequence, it is extracted from the input sequence, but discarded and not written to s. getline 没
利用stringstream from sstream 类型转换
tellp
Get position in output sequence (public member function )
seekp
Set position in output sequence (public member function )
clear//读完了要请flags
Set error state flags (public member function )
tellp
Get position in output sequence (public member function )
seekp
Set position in output sequence (public member function )
str//用来清除内容传“”
Get/set content (public member function )
fgets
char * fgets ( char * str, int num, FILE * stream );
(1)
istream& getline (istream& is, string& str, char delim);
(2)
istream& getline (istream& is, string& str);
Get line from stream into string
Extracts characters from is and stores them into str until the delimitation character delim is found (or the newline character, '\n', for (2)).
The extraction also stops if the end of file is reached in is or if some other error occurs during the input operation.
If the delimiter is found, it is extracted and discarded (i.e. it is not stored and the next input operation will begin after it).
Note that any content in str before the call is replaced by the newly extracted sequence.
Each extracted character is appended to the string as if its member push_back was called.