求助,679三个点WA了

P1001 A+B Problem

JordanPoole_3 @ 2022-08-23 20:54:08

#include<bits/stdc++.h> 
using namespace std;
int a,b;
int main()
{
   cin>>a>>b;
   cout<<(int)((pow(max(a,b),2)-pow(min(a,b),2))/(max(a,b)-min(a,b)));
}

by _Komorebi_ @ 2022-10-14 12:34:48

#include <bits/stdc++.h>
using namespace std;
int main()
{
long long a,b;//定义,保险long long
cin>>a>>b;
cout<<a+b<<endl;//直接输出
}

by Jasonshan10 @ 2022-10-27 18:27:32

long long能过吗


by Cload_Honor @ 2023-02-04 16:50:10

@Shanjunhao100510 推荐高精度


by CznTree @ 2023-02-13 20:46:09

乔丹普尔我擦 还不出来挨打


by User700176 @ 2023-08-22 14:17:58

#include<iostream>
#include<cstring>
using namespace std;
const int size=9999;
int main() {
    int a[size]= {0},b[size]= {0},c[size]= {0};
    string A,B;
    cin>>A;
    cin>>B;
    int len_a=A.length(),len_b=B.length();
    for(int i=0; i<len_a; i++) {
        a[i]=(A[(len_a-1)-i]-'0');
    }
    for(int i=0; i<len_b; i++) {
        b[i]=(B[(len_b-1)-i]-'0');
    }
    int len_c=(len_a>len_b)?len_a:len_b;
    int p,flag=0;
    for(int i=0; i<len_c; i++) {
        p=a[i]+b[i]+flag;
        if(i==len_c-1&&p>=10)
            len_c+=1;
        if(p>=10) {
            c[i]=p%10;
            flag=1;
        } else {
            flag=0;
            c[i]=p;
        }
    }
    for(int i=len_c-1; i>=0; i--) {
        if(c[i]==0&&c[i-1]==0||c[i]==0&&c[i-1]!=0) {
            len_c--;
        }
        if(c[i]!=0) {
            break;
        }
    }
    for(int i=len_c-1; i>=0; i--) {
        cout<<c[i];
    }
    cout<<endl;
    return 0;
}

上一页 |