c/c++语言开发共享【模版】快速读入/输出

快速读入模版 …


快速读入模版

template < class t > inline void read(t &x) {     x = 0;     char c = getchar();         bool f = 0;     while (!isdigit(c)) {         f ^= c == '-';         c = getchar();     }     while (isdigit(c)) {         x = (x << 3) + (x << 1) + (c ^ 48);         c = getchar();     }     if (f)         x = ~x + 1; }

快速输出模版

template < class t > inline void print(t x) {     if (x < 0) {         putchar('-');         x = ~x + 1;     }     if (x > 9)         print(x / 10);     putchar(48 + x % 10); }

本文来自网络收集,不代表计算机技术网立场,如涉及侵权请联系管理员删除。

ctvol管理联系方式QQ:251552304

本文章地址:https://www.ctvol.com/c-cdevelopment/605816.html

(0)
上一篇 2021年5月13日
下一篇 2021年5月13日

精彩推荐