-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfastio.cpp
38 lines (38 loc) · 1.24 KB
/
fastio.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include "fastio.h"
#include <limits>
#include <string>
using namespace fastio;
using namespace symbols;
using u32 = unsigned;
using f64 = double;
ifstream ifs("fastio.in");
ofstream ofs("fastio.out");
int main() {
int n;
u32 m;
bool f;
char c, s[105];
f64 d;
std::string t;
ifs >> n >> m >> f >> c >> s >> d;
ofs << n << ends << m << ends << f << ends << c << ends << s << ends << d << endl;
ifs.ignore() >> ws;
ifs.get(t);
ofs << t << endl;
ofs << showbase << showpos;
ofs << bin << std::numeric_limits<int>::max() << endl;
ofs << oct << std::numeric_limits<int>::max() << endl;
ofs << dec << std::numeric_limits<int>::max() << endl;
ofs << hex << std::numeric_limits<int>::max() << endl;
ofs << reset;
ofs << boolalpha << true << ends << false << noboolalpha << endl;
ofs << uppercase << new int << lowercase << endl;
ofs << nullptr << endl;
ofs << 3.14 << ends << fixed << 3.14 << defaultfloat << endl;
ofs << std::numeric_limits<f64>::infinity() << ends;
ofs << std::numeric_limits<f64>::quiet_NaN() << endl;
ofs << setfill('0');
ofs << setw(20) << left << "left" << endl;
ofs << setw(20) << right << "right" << endl;
while (ifs >> n) ofs << n << endl;
}