zoukankan      html  css  js  c++  java
  • 其他注意事项

    1.设置环境:-Wl,-stack=512000000 -Wall -Wextra -Wconversion

    2.一定设置自动保存!!!

    3.对拍程序:a+b problem为例

    正解1:

    #include<bits/stdc++.h>
    using namespace std;
    
    int n,m;
    
    int main()
    {
        cin>>n>>m;
        cout<<n+m<<endl;
        return 0;
    }

    正解2:

    #include<bits/stdc++.h>
    using namespace std;
    /*
    inline int read()
    {
        int ret=0;char ch=0,pre=0;
        do pre=ch,ch=getchar();while((ch<'0')||(ch>'9'));
        do ret=ret*10+ch-'0',ch=getchar();while((ch>='0'&&ch<='9'));
        if(pre=='-') ret=-ret;
        return ret;
    }*/
    
    inline int read()
    {
        int ret=0;char ch=0,pre=0;
        do pre=ch,ch=getchar();while((ch<'0')||ch>'9');
        do ret=ret*10+ch-'0',ch=getchar();while((ch>='0')&&(ch<='9'));
        if(pre=='-') ret=-ret;
        return ret;
    }
    
    int n,m;
    
    int main()
    {
        n=read();m=read();
        printf("%d
    ",n+m);
        return 0;
    }

    随机数:

    #include<bits/stdc++.h>
    using namespace std;
    
    int main()
    {
        srand(time(0));
        cout<<rand()%15564<<" "<<rand()%545345;
    }

    对拍:

    #include<bits/stdc++.h>
    using namespace std;
    
    int main()
    {
        while(1)
        {
            system("suijishu>in.txt");
            system("a+b<in.txt>out.txt");
            system("4578<in.txt>ans.txt");
            if(system("fc out.txt ans.txt"))
            break;
        }    
        return 0;
    }

    4.一定用万能头!!!

    5.快读:

    inline int read()
    {
        int ret=0;char ch=0,pre=0;
        do pre=ch,ch=getchar();while((ch<'0')||ch>'9');
        do ret=ret*10+ch-'0',ch=getchar();while((ch>='0')&&(ch<='9'));
        if(pre=='-') ret=-ret;
        return ret;
    }

    随时补充

    -----------end-------------

  • 相关阅读:
    1.Apache与Tomcat
    jeeplus 多选框
    GIT 回滚
    jsp 中data 转换 字符串
    Pattern和Matcher中表达式
    web.xml 详细介绍
    $.ajax()方法详解
    My 2016
    如何做好一个保安队长。
    集合之WeakHashMap
  • 原文地址:https://www.cnblogs.com/yxr001002/p/14082224.html
Copyright © 2011-2022 走看看