【qbxt day1】 乱七八糟什么都有

1.读入输出问题

  1. ios::sync_with_stdio(false);
  2. scanf 读法 
    int x; scanf("%d",&x);
    double y; scanf("%lf",&y);
    char z[100]; scanf("%s",s+1);
    
    #ifdef WIN32
    #define LL "%l64d"
    #else
    #define LL "%lld"
    #endif 
    
    string s;
    scanf("%lld",&z)//unix linux ubuntu mac 
    scanf("%l64d",&z)//WIN32 
  3. 快读模板
    inline int getint()
    {
        int x=0;
        char c=' ';
        while (c<'0' || c>'9')
            c=getchar();
        while (c>='0' && c<='9')
        {
            x=x*10+c-'0';
            c=getchar();
        }
        return x;
    }

猜你喜欢

转载自www.cnblogs.com/civilization-ga/p/9489200.html