首页 > 其他 > 详细

输入输出挂

时间:2018-07-24 15:27:49      阅读:131      评论:0      收藏:0      [点我收藏+]
 1 bool Finish_read;
 2 template<class T>inline void read(T &x)
 3 {
 4     Finish_read=0;
 5     x=0;
 6     int f=1;
 7     char ch=getchar();
 8     while(!isdigit(ch))
 9     {
10         if(ch==-)f=-1;
11         if(ch==EOF)return;
12         ch=getchar();
13     }
14     while(isdigit(ch))x=x*10+ch-0,ch=getchar();
15     x*=f;
16     Finish_read=1;
17 }
18 template<class T>inline void print(T x)
19 {
20     if(x/10!=0)print(x/10);
21     putchar(x%10+0);
22 }
23 template<class T>inline void writeln(T x)
24 {
25     if(x<0)putchar(-);
26     x=abs(x);
27     print(x);
28     putchar(\n);
29 }
30 template<class T>inline void write(T x)
31 {
32     if(x<0)putchar(-);
33     x=abs(x);
34     print(x);
35 }

贴的某个大佬的板子,还没用过,不知道好不好用。

输入输出挂

原文:https://www.cnblogs.com/stranger-/p/9359997.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!