Advertisement

华为OD机试真题 C++快递运输 2022第4季度 | 100分

阅读量:

前言

复制代码
 #include <bits/stdc++.h>

    
  
    
 using namespace std;
    
  
    
 typedef long long ll;
    
  
    
 vector<int> nums;
    
  
    
 void getNums(vector<int> &nums) 
    
 {
    
     char ch;
    
     int x = 0;
    
     while (true) {
    
     ch = getchar();
    
     if (isdigit(ch)) {
    
         x = (x << 3 + x << 1) + (ch - '0');
    
     } else {
    
         nums.emplace_back(x);
    
         x = 0;
    
         if (ch == '\n') return;
    
     }
    
     }
    
 }
    
  
    
 int main() 
    
 {
    
     getNums(nums);
    
     int limits;
    

全部评论 (0)

还没有任何评论哟~