USACO Section1.1 TEXT Submitting Solutions
2016-05-27 22:46
218 查看
题目链接:http://train.usaco.org/usacotext2?a=Hh9AZgSTKZi&S=grade
题目:
The simplest programming challenge is named 'test' and requires you to read a pair of small integers from a single input line in the file 'test.in'
and print their sum to the file 'test.out'.
参考答案:
题目:
The simplest programming challenge is named 'test' and requires you to read a pair of small integers from a single input line in the file 'test.in'
and print their sum to the file 'test.out'.
参考答案:
/*
<span style="font-family: Arial, Helvetica, sans-serif;">ID: your id here</span>
LANG: C TASK: test */ #include <stdio.h> #include <stdlib.h> int 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); }
//在题目给出的范例答案中添加#include <stdlib.h>
相关文章推荐
- 字符串匹配算法-KMP
- 使用jdbc+servlet进行登陆账号的认证
- Spring-bean构造方法
- USACO5.15.2 新的一章w
- Contiki协议栈Rime:匿名广播abc
- 关于简历不得不说的那些事儿
- C语言应用初步感受
- 数塔python
- 读书笔记和sprint总结
- PostgreSQL索引分类及使用
- 计算结果总是100的程序
- 使用HashMap,如果key是自定义的类,就必须重写hashcode()和equals()。
- JAVA反射机制(二)
- Spring Data JPA 1.10.1 详解一之Spring Data JPA介绍
- 一个屌丝程序猿的人生(十八)
- Mapreduce参数调节
- java中创建线程主要有三种方式
- 1005. 继续(3n+1)猜想 (25)
- qt中绘图事件paintEvent 的用法
- java bean