测评会员优惠活动进行中 · 开通 VIP,有效期内测评不限次 VIP 优惠中 · 测评不限次 立即查看

A67919. 下面代码实现两个整数除法,其中被除数为一个“大整数”,用字符串表示,除数是一个小整数,用 int 表示,则横线处应该填写( )。1 int main(){

单选题

题目描述

下面代码实现两个整数除法,其中被除数为一个大整数,用字符串表示,除数是一个小整数,用 int 示,则横线处应该填写( )。

1 int main(){
2  string s;
3  int b;
4  cin >> s >> b;
5
6  vector<int> a;
7  for(char c : s){
8   a.push_back(c - '0');
9  }
10
11  vector<int> c;
12  long long rem = 0;
13
14  for(int i = 0; i < a.size(); i++){
15   rem = rem * 10 + a[i];
16   int q = rem / b;
17   c.push_back(q);
18   ______________________
19  }
20
21  int pos = 0;
22  while(pos < c.size() - 1 && c[pos] == 0) pos++;
23
24  for(int i = pos; i < c.size(); i++){
25   cout << c[i];
26  }
27
28  cout << endl;
29  cout << rem << endl;
30  return 0;
31 }

选项(单选)