全部评论 39

  • 看我别忘了点赞哦~

    2023-09-18 来自 浙江

    14
    • 6
      原本两三行的代码
      硬生生写到了几十行
      不愧是大佬
      (doge

      2023-09-25 来自 四川

      1
    • 就这?????????????
      #include<iostream>
      #include <algorithm>
      #include <bits/stdc++.h>
      #include <math.h>
      #include <cmath>
      #include<string>
      #include<cstring>
      #include<list>
      #include<map>
      #include<queue>
      #include<iterator>
      #include<stack>
      using namespace std;

      #define ll long long
      const int N = 1010;

      int RAND_1(ll a,ll b){
      ll n = a + b;
      return n;
      }

      int RAND_2(string a, string b, int n[500], int m[500], int ans[501]){
      for(int i = 0; i < a.size(); i++)
      n[i] = a[a.size() - i - 1] - '0';
      for(int i = 0; i < b.size(); i++)
      m[i] = b[b.size() - i - 1] - '0';
      int len_maxn = max(a.size(), b.size()) + 1;
      for(int i = 0; i < len_maxn; i++)
      {
      ans[i] = n[i] + m[i] + ans[i];
      if(ans[i] > 9)
      {
      ans[i + 1]++;
      ans[i] = ans[i] % 10;
      }
      }
      while(ans[len_maxn - 1] == 0 && len_maxn > 0) len_maxn--;
      for(int i = len_maxn - 1; i >= 0; i--) cout << ans[i];
      return 0;
      }

      int RAND_3(ll a, ll b){
      ll ans = 0;
      for(int i = 0; i < a; i ++ ) {
      ans ++;
      }
      for(int i = 0; i < b; i ++ ) {
      ans ++;
      }
      return ans;
      }

      int n[1010], m[1010],c[1010];
      int main(){
      srand(time(0));
      ll a , b;
      string z , y;
      int x;
      x = 1 + rand() % 3;
      if(x == 1){
      cin >> a >> b;
      int ans = RAND_1(a,b);
      cout << ans;
      }
      if(x == 2){
      cin >> z >> y;
      RAND_2(z , y , n , m, c);
      }
      if(x == 3){
      cin >> a >> b;
      int ans = RAND_3(a, b);
      cout << ans;
      }
      return 0;
      }

      2024-11-03 来自 广东

      2
    • (狗式点头)

      2025-01-26 来自 浙江

      0
  • 还用高精度……

    2023-09-18 来自 浙江

    2
  • 这个有意思,6

    2023-09-18 来自 浙江

    2
  • 大佬

    2026-02-15 来自 江苏

    1
  • 搞得我都懵了

    1周前 来自 浙江

    0
  • 1周前 来自 河北

    0
  • 方法没错

    2026-04-04 来自 浙江

    0
  • 1234

    2026-04-02 来自 浙江

    0
  • 厉害

    2026-03-28 来自 江苏

    0
  • 1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1

    2026-03-22 来自 江苏

    0
  • ?

    2026-03-19 来自 浙江

    0
  • n

    2026-03-14 来自 浙江

    0
  • ok

    2026-03-12 来自 浙江

    0
  • ok

    2026-03-12 来自 浙江

    0
  • ok

    2026-03-10 来自 浙江

    0
  • @ppl_cjdst(92134) 你会坑他吗

    2026-02-28 来自 上海

    0
  • 想的可能也太多了

    2026-02-26 来自 福建

    0
  • 6666666666666
    #include <bits/stdc++.h>
    int main(){
    long long a,b; stdcin>>a>>b; stdcout<<a+b;
    }

    2026-02-23 来自 浙江

    0
  • ok

    2026-02-12 来自 浙江

    0
  • #include<bits/stdc++.h>
    using namespace std;
    int main(){
        string a,b,c="";
        cin>>a>>b;
        reverse(a.begin(),a.end());
        reverse(b.begin(),b.end());
        int h=0,l=max(a.size(),b.size()),s1=a.size(),s2=b.size();
        for(unsigned int i=0;i<l||h;i++){
            int s=h;
            if(i<s1)s+=a[i]-'0';
            if(i<s2)s+=b[i]-'0';
            h=s/10;
            c+=((s%10)+'0');
        }
        reverse(c.begin(),c.end());
        int k=0,ll=c.size();
        while(k<l-1&&c[k]=='0')k++;
        c.erase(0,k);
        cout<<c;
        return 0;
    }
    

    2025-12-29 来自 广东

    0
暂无数据

提交答案之后,这里将显示提交结果~

首页