码迷,mamicode.com
首页 > 其他好文 > 详细

快读快输板子

时间:2019-04-13 23:18:29      阅读:269      评论:0      收藏:0      [点我收藏+]

标签:ring   cst   name   reg   tchar   namespace   class   define   ace   

 1 #include <cstdio>
 2 #include <cstring>
 3 #include <cctype>
 4 #define rgi register int
 5 #define il inline
 6 #define ll long long
 7 
 8 using namespace std;
 9 
10 int a, b;
11 
12 il int read()
13 {
14     rgi x = 0, f = 0, ch;
15     while(!isdigit(ch = getchar())) f |= ch == -;
16     while(isdigit(ch)) x = (x << 1) + (x << 3) + (ch ^ 48), ch = getchar();
17     return f ? -x : x;
18 }
19 
20 il void write(int x)
21 {
22     if(x < 0)    putchar(-), x = -x;
23     if(x > 9)    write(x / 10);
24     putchar(x % 10 + 48);
25 }
26 
27 int main()
28 {
29     a = read();
30     b = read();
31     write(a + b);
32     return 0;
33 }

 

快读快输板子

标签:ring   cst   name   reg   tchar   namespace   class   define   ace   

原文地址:https://www.cnblogs.com/Clever-Jimmy/p/read_and_write.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!