2019-05-30
20:19:57
加油!!!
sort(a + 1, a + 5);
卡了一会儿
1 #include <bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 5 int main() 6 { 7 ll a[5], e; 8 ll sum = 0; 9 for (int i = 1; i <= 4; i++) 10 { 11 scanf("%lld ", &a[i]); 12 } 13 scanf("%lld", &e); 14 if (a[2] < a[3] || a[4] < a[1]) 15 { 16 cout << 0; 17 return 0; 18 } 19 else 20 { 21 sort(a + 1, a + 5); 22 sum = a[3] - a[2] + 1; 23 if (e >= a[2] && e <= a[3]) 24 { 25 sum--; 26 } 27 cout << sum << endl; 28 } 29 30 return 0; 31 }