/ ITcode / 讨论 / 团队 /

上传数据

请建立一个.zip压缩包,包含的文件如下:

  • - Config.ini: 题目配置文件
  • + Input (目录): 放置所有标准测试输入文件
  • |- input0.txt
  • |- input1.txt
  • |- ...
  • + Output (目录): 放置所有标准测试输出文件
  • |- output0.txt
  • |- output1.txt
  • |- ...

Config.ini生成程序:

#include <iostream>
#include <string>
#include <cstdlib> 
#include <cstdio>

int main () {
    std :: string name, file_name, in_name, out_name;
    int num, remain, time_limit, memory_limit, mark;
    std :: cout << "Problem Name:" << std :: endl;
    std :: cin >> name;
    file_name = "Config.ini";
    FILE *out = fopen (file_name.c_str(), "w");
    std :: cout << "Test Case Number:" << std :: endl;
    std :: cin >> num;
    fprintf (out, "%d\n", num); 
    if (100 % num) remain = 100 % num;
    std :: cout << "Input:" << name << ".?:" << std :: endl;
    std :: cin >> in_name;
    std :: cout << "Output:" << name << ".?:" << std :: endl;
    std :: cin >> out_name;
    std :: cout << "0. Set All" << std :: endl << "1. Set Each" << std :: endl;
    std :: cin >> mark;
    if (!mark) {
        std :: cout << "Time Limit(s):" << std :: endl;
        std :: cin >> time_limit;
        std :: cout << "Memory Limit(KB):" << std :: endl;
        std :: cin >> memory_limit;
    }
    for (int i = 1; i <= num; i++) {
        int score = 100 / num;
        std :: string input = name, output = name, id;
        for (int t = i; t; t /= 10) id = (char) ('0' + t % 10) + id;
        input = input + id + "." + in_name; output = output + id + "." + out_name;
        if (mark) {
            std :: cout << "Case " << i << ":" << std :: endl;
            std :: cout << "Time Limit(s):" << std :: endl;
            std :: cin >> time_limit;
            std :: cout << "Memory Limit(KB):" << std :: endl;
            std :: cin >> memory_limit;
        }
        if (i == num - remain + 1) score++;
        fprintf (out, "%s|%s|%d|%d|%d\n", input.c_str(), output.c_str(), time_limit, score, memory_limit);
    }   
    fclose (out);
    std :: cout << "Finish!" << std :: endl;
    getchar ();
    system ("pause");
    return 0;
}

1 条评论

  • 1