Habibullah_Asif

Untitled

Jan 21st, 2021
543
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.  
  7.     string s;
  8.     getline(cin, s);
  9.     vector<int> v;
  10.     for(int i = 0; i < s.size(); i++){
  11.         int t = s[i] - '0';
  12.         if(t >= 0 && t <= 9){
  13.             v.push_back(t);
  14.         }
  15.     }
  16.     for(int i = 0; i < v.size(); i++){
  17.         cout << v[i] << " ";
  18.     }
  19.     return 0;
  20. }
  21.  
  22.  
RAW Paste Data