template<int P>
struct mod_int{
using Z=mod_int;
static int mo(int x){return x<0?x+P:x;}
int x;
int val()const{return x;}
mod_int():x(0){}
template<class T>mod_int(const T&x_):x(x_>=0&&x_<P?static_cast<int>(x_):mo(static_cast<int>(x_%P))){}
//...
friend istream& operator>>(istream&is,Z&x){long long y;is>>y;x=Z(y);return is;}
friend ostream& operator<<(ostream&os,const Z&x){return os<<x.val();}
};
const int P=119<<23|1;
using Z=mod_int<P>;
#include<bits/stdc++.h>
using namespace std;
signed main(){
ios::sync_with_stdio(false);
ifstream fin("in.txt");
ofstream fout("out.txt");
fstream fio("io.txt");
fin.tie(&fout);
int x;
fin>>x; fout<<x;
fio>>x; fio<<x;
return 0;}
标签:stream,int,static,fout,txt,fin
From: https://www.cnblogs.com/shaojia/p/16810966.html