usaco 问题

来源:百度知道 编辑:UC知道 时间:2024/09/28 17:51:04
1 如何测试
请详细给出样例
(名字可用XX代替)
2 USACO译题网站(给出网址)
3 USACO讨论专区(汉语)(给出网址)

1.
/*
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);
}

Below is a simple solution in the C++ programming language. Note the use of 'return (0);', which is usually required to exit properly.

/*
ID: your_id_here
PROG: test
LANG: C++
*/
#include <iostream>
#include <fstream>
#include <string>

using namespace std;

int main() {
ofstream fout ("test.out");
ifstream fin ("test.in");
int a, b;
fin >> a >> b;
fout << a+b << endl;