#include<iostream>
using namespace std;
int main()
{
//取消同步流
//一般比scanf快 但是注意不要使用cout << endl; 改用 cout << '\n';
ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
return 0;
}
一定要注意不要使用endl,因为endl用于在输出流中插入一个换行符并刷新输出流,我们只需要换行就好了不需要刷新输出流。
#include<iostream>
using namespace std;
int main()
{
//取消同步流
//一般比scanf快 但是注意不要使用cout << endl; 改用 cout << '\n';
ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
return 0;
}
一定要注意不要使用endl,因为endl用于在输出流中插入一个换行符并刷新输出流,我们只需要换行就好了不需要刷新输出流。