vector<int> mul(vector<int> &m, int n) { vector<int> res; int t = 0; for (int i = 0; i < m.size() || t; i ++ ) // 1 { if (i < m.size()) t += m[i] * b; res.push_back(t % 10); // 2 t /= 10; } for (; res.size() > 1 && res.back() == 0;) res.pop_back(); // 3 return res; }
intmain() { string a; int n; cin >> a >> n; vector<int> m; for (int i = a.length() - 1; i >= 0; i -- ) m.push_back(a[i] - '0'); vector<int> res; res = mul(m, n); for (int i = res.size() - 1; i >= 0; i -- ) cout << res[i]; return0; }
vector<int> mul(vector<int> &m, int n) { vector<int> res; int t = 0; for (int i = 0; i < m.size(); i ++ ) { t = m[i] * n + t; res.push_back(t % 10); t /= 10; } if (t) res.push_back(t); for (; res.size() > 1 && res.back() == 0;) res.pop_back(); return res; }
intmain() { string a; int n; cin >> a >> n; vector<int> m; for (int i = a.length() - 1; i >= 0; i -- ) m.push_back(a[i] - '0'); vector<int> res; res = mul(m, n); for (int i = res.size() - 1; i >= 0; i -- ) cout << res[i]; return0; }