Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int func(int l1,int r1,int l2,int r2)
- {
- return max(0,min(r1,r2)-max(l1,l2));
- }
- int main()
- {
- cout<<func(0,5,6,10)<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement