Ledger Nano X - The secure hardware wallet
SHARE
TWEET

Untitled

a guest Apr 4th, 2020 133 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // 4 задача
  2. #include <iostream>  
  3. #include <string>
  4. #include <algorithm>
  5. #include <vector>
  6. using namespace std;
  7. int main()
  8. {
  9.     int k;
  10.     cin >> k;
  11.     vector <string> strings;
  12.     vector <int> num(k);
  13.     vector <int> count(k);
  14.     string d, n;
  15.     int m;
  16.     for (int i = 0; i < k; i++) {
  17.         cin >> d;
  18.         strings.push_back(d);
  19.     }
  20.     for (int i = 0; i < k; ++i) {
  21.         n = strings[i];
  22.         m = n.size();
  23.         for(int j = 0; j < m; ++j)
  24.             if (n[j] == '1') {
  25.                 num[i] = j;
  26.                 break;
  27.             }
  28.         }
  29.     string a;
  30.     int b;
  31.     for (int i = 0; i < k; ++i) {
  32.         a = strings[i];
  33.         b = a.size();
  34.         for (int j = num[i]; j < b; j++) {
  35.             if (a[j] == '0') {
  36.                 count[i]++;
  37.             }
  38.         }
  39.     }
  40.     return 0;
  41. }
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