|
|
back to boardPlease help me! Where I did error??? Cpp #include<iostream> using namespace std; int main() { int k, n, S =0; cin >> k >> n; if (k, n >= 1 && k, n <= 100) { int *A = (int*)malloc(n*sizeof(int)); for (int i = 0; i < n; i++) { cin >> A[i]; if (!(A[i] >= 0 && A[i] <= 100)) break; } for (int i = 0; i < n; i++) S += A[i] - k; cout << S << endl; } return 0; } Edited by author 05.02.2015 20:02 |
|
|