Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- int a[1000];
- using namespace std;
- int main()
- {
- int k, n, sum = 0, otvet = 0, cars = 0;
- cin >> k >> n;
- for (int i = 0; i < n; i++)
- {
- cin >> a[i];
- cars = a[i]-k+a[i+1];
- }
- cout << cars;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement