Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <string>
- using namespace std;
- int main()
- {
- ofstream fout("paint.out");
- ifstream fin("paint.in");
- int a, b, c, d, output, temp;
- fin >> a >> b >> c >> d;
- if (c < a)
- {
- printf("Hello");
- temp = c;
- c = a;
- a = temp;
- temp = b;
- b = d;
- d = temp;
- }
- if (c <= b)
- {
- if (d > b)
- {
- output = d - a;
- }
- else
- {
- output = b - a;
- }
- }
- else
- {
- output = (b - a) + (d - c);
- }
- fout << output << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement