Ledger Nano X - The secure hardware wallet
SHARE
TWEET

Lab-4 Korvyakov-9

a guest Apr 1st, 2020 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //
  2. //  main.cpp
  3. //  lab-4
  4. //
  5. //  Created by Nikita Korvyakov on 18.03.2020.
  6. //  Copyright © 2020 Nikita Korvyakov. All rights reserved.
  7. //
  8.  
  9. #include <iostream>
  10. using namespace std;
  11. int main() {
  12.     // insert code here...
  13.     int arr[100],n,k,sum=0;
  14.     cin >> n >> k;
  15.     for(int i=0;i<n;i++){
  16.         cin >> arr[i];
  17.         if(arr[i]%k==0){
  18.             sum+=arr[i];
  19.         }
  20.     }
  21.     cout << sum << endl;
  22.    
  23.     return 0;
  24. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top