训练赛的一些说明
程序的输入输出
更详细的说明
对于C++程序:
#include <iostream>
using namespace std;
...
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
// 读入a, b, c
cin >> a >> b >> c;
// 输出a, b + c
cout << a << " " << b + c;
...
对于C程序:
#include <stdio.h>
...
// 读入a, b, c
scanf("%d%d%d", &a, &b, &c);
// 输出a, b + c
printf("%d %d", a, b + c);
...
可能会用到的 C stdio 占位符:
%d, %i 代表整数
%f 浮点
%lf 双精度浮点数
%s 字符串
%c 字符
有效的输入输出
例如一道题目,要求输入两个字符a, b, 再输出它们的合,那么下面的便是一组有效输入输出:
Input
1 1
Output
2
而
请输入一个整数a: 请输入一个整数b:答案为:2
则不是
关于模板
CPC竞赛是可以带纸质资料进去的,所以各位做题的时候可以去看算法模板,但是请不要搜索题解
