merkator

1787

Oct 2nd, 2012
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.26 KB | None | 0 0
  1. #include <cstdio>
  2.  
  3. int main () {
  4.     int k, n;
  5.     int array[100];
  6.     scanf("%d%d", &k, &n);
  7.     for (int i=1; i<=100; i++){
  8.         scanf ("%d", &array[i]);
  9.     }
  10.     int sum=0;
  11.     for (int i=1; i<=100; i++) {
  12.         sum+=array[i];
  13.         }
  14.     printf("%d", sum-(n*k));
  15.     return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment