USACO做题介绍

来源:互联网 发布:软件项目风险定义 编辑:程序博客网 时间:2024/04/29 14:26

http://ace.delos.com/usacogate
帐号:helihui1

题目提交样例
帐号的id我的是:7758

PROGRAM NAME: test //题目会有这么一句
/*
ID: your_id_here
PROG: test   //修改
LANG: C++
*/
#include <iostream>
#include <fstream>
#include <string>

using namespace std;

int main() {
    ofstream fout ("test.out"); //test.out 在题目里说明是什么的
    ifstream fin ("test.in"); //同上
    int a, b;
    fin >> a >> b;
    fout << a+b << endl;
    return 0;
}


/*
ID: your_id_here
LANG: C
TASK: test
*/
#include <stdio.h>
main () {
    FILE *fin  = fopen ("test.in", "r");
    FILE *fout = fopen ("test.out", "w");
    int a, b;
    fscanf (fin, "%d %d", &a, &b); /* the two input integers */
    fprintf (fout, "%d/n", a+b);
    exit (0);
}

 

原创粉丝点击