[关闭]
@Codewzs 2019-04-14T08:29:24.000000Z 字数 234 阅读 680

输出优化

C++模板


  1. template<class T>void w(T x)
  2. {
  3. if(x<0)putchar('-'),x=-x;
  4. if(x>9)w(x/10);
  5. putchar(x%10+'0');
  6. }
  7. template<class T,class... Y>void w(T t,Y... a){w(t);w(a...);}

注意:使用此输入优化,请在头文件前加上以下代码:
#pragma GCC diagnostic error "-std=c++11"

使用方法:

  1. int a=1,b=2;
  2. w(a,b);
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注