Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <math.h>
- using namespace std;
- int main()
- {
- ifstream f; f.open("input.txt");
- ofstream ff; ff.open("output.txt");
- int a=0,b=0,c=0,d=0,q=0;
- f>>a>>b>>c>>d;
- if(a>b){
- swap(a,b);
- }
- if(c>d){
- swap(c,d);
- }
- for(int i=a;i<=b;i++){
- for(int j=c;j<=d;j++){
- if(i==j){
- q++;
- }
- }
- }
- ff<<q;
- ff.close();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement