c++快读快写
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
这段代码的意思是删除iostream的输入、输出缓存,可以节省许多时间,使效率与scanf与printf相差无几.
方法二:
#include<cstdio>
//或者#include <stdio.h>
int main( ) {
char str[100];
int i;
printf( "Enter a value :");
scanf("%s %d", str, &i);
printc++f( "\nYou entered: %s %d ", str, i);
printf("\n");
return 0;
}
注意,如果出现警告:“scanf返回值被忽略”,可在vs里关掉SDL检查。详见:
本文来自博客园,作者:尚映君,转载请注明原文链接:https://www.cnblogs.com/YingJunShang/p/17763348.html

c++快读快写
浙公网安备 33010602011771号