zoukankan      html  css  js  c++  java
  • c++ 快读

    c++快读

    读自然数

    #include <cstdio>
    #include <algorithm>
    #include <cstring>
    using namespace std;
    inline long long rd(){
    	register int x=0;
    	register char ch=getchar();
    	while(ch<'0'||ch>'9')ch=getchar();
    	while(ch>='0'&&ch<='9')x=(x<<3)+(x<<1)+(ch^48),ch=getchar();
    	return x;
    }
    

    读整数

    #include <cstdio>
    #include <algorithm>
    #include <cstring>
    using namespace std;
    inline long long rd(){
        register int x=0,f=0;register char ch=getchar();
        while(ch<'0'||ch>'9')f|=ch=='-',ch=getchar();
        while(ch>='0'&&ch<='9')x=(x<<3)+(x<<1)+(ch^48),ch=getchar();
        return f?-x:x;
    }
    

    以上快读调用:

    读入

    x=rd();
    
  • 相关阅读:
    项目总结升级2
    项目总结升级1
    项目总结升级
    项目总结4
    项目总结3
    体温填报app2.0开发
    每日博客
    第一周开课博客
    学习日报
    学习日报
  • 原文地址:https://www.cnblogs.com/Lour688/p/13204479.html
Copyright © 2011-2022 走看看