zoukankan      html  css  js  c++  java
  • 出题模板

     1 #include <cstdio>
     2 #include <iostream>
     3 #include <cstdlib>
     4 #include <time.h>
     5 #include <cstring>
     6 #include <windows.h>
     7 using namespace std;
     8 
     9 char in[15] = "std00.in";
    10 char out[15] = "std00.out";
    11 const int L_file = 1;
    12 const int R_file = 2;
    13 
    14 void _init()   //每次循环的数值清空
    15 {
    16     //此处清零 
    17 
    18     return ;
    19 }
    20 
    21 void _in()
    22 {
    23     in[8] = '';
    24     out[9] = '';
    25     for(int __i = L_file; __i <= R_file; __i ++)
    26     {
    27          in[3] = __i / 10 + '0', in[4] = __i % 10 + '0';
    28         if(freopen(in, "w", stdout) == NULL) system("in失败");
    29         
    30         //此处开始打印测试数据 
    31         
    32         system("已处理完一项输入数据");
    33     }
    34     return ;
    35 }
    36 
    37 void _out()
    38 {
    39     int n, m;
    40     for(int __i = L_file; __i <= R_file; __i ++)
    41     {
    42         _init();
    43          in[3] = __i / 10 + '0', in[4] = __i % 10 + '0';
    44         if(freopen(in, "r", stdin) == NULL) system("in2失败");
    45             
    46         out[3] = __i / 10 + '0', out[4] = __i % 10 + '0';
    47         if(freopen(out, "w", stdout) == NULL) system("out失败");
    48         
    49         //此处放代码
    50         
    51         system("已处理完一项输出数据");
    52     } 
    53     return ;
    54 }
    55 
    56 int main()
    57 {
    58     srand((unsigned)time(0));
    59     
    60     _in();
    61     _out();
    62     
    63     fclose(stdin);
    64     fclose(stdout);
    65     
    66     return 0;
    67 }
  • 相关阅读:
    JLOI2012:时间流逝
    bzoj 5217: [Lydsy2017省队十连测]航海舰队
    bzoj 4894: 天赋
    bzoj 4870: [Shoi2017]组合数问题
    bzoj 1558: [JSOI2009]等差数列
    bzoj 4945: [Noi2017]游戏
    bzoj 2142: 礼物
    bzoj 5248: [2018多省省队联测]一双木棋
    51nod2383
    codeforces24D
  • 原文地址:https://www.cnblogs.com/chxer/p/4483234.html
Copyright © 2011-2022 走看看