Untitled
unknown
c_cpp
2 years ago
534 B
3
Indexable
#include <bits/stdc++.h> using namespace std; int main(int argc, char **argv) { ifstream fin("input.txt"); ofstream fifo_in(argv[1]); ifstream fifo_out(argv[2]); int a, b, res; fin >> a >> b; fifo_in << a << ' ' << b << '\n'; fifo_in.flush(); fifo_out >> res; if (a+b == res) { cerr << "A-ha, you're the best adding program I've ever met!\n"; cout << 1 << '\n'; } else { cerr << "How dreadful, never met anyone as dumb as you...\n"; cout << 0 << '\n'; } fin.close(); fifo_in.close(); fifo_out.close(); }
Editor is loading...