60分求调

P1001 A+B Problem

Phigros_11calors @ 2024-10-21 16:44:27

#include <bits/stdc++.h>
using namespace std;
int tree(int a){
    if(a<=1)return a;
    else if(a==2)return 3;
    else return 2147483647;
}
double pow(double a,int b){
    double d=1;
    for(int i=1;i<=b;i++){
    d*=a;
}
return d;
}
int main()
{
long long a,b;
    cin>>a>>b;
    a=log(pow(1.000001,a))/log(1.000001);
    if(a<=1)a=tree(a);
    cout<<a+b;
    return 0;
}

by lostxxx @ 2024-10-21 16:52:39

\huge 6

by caijunhan2012 @ 2024-10-21 17:48:52

#include<bits/stdc++.h>
using namespace std;
int main(){
    int a,b;
    cin>>a>>b;
    cout<<a+b;
return 0;
}

这样就OK了


by Motonic_queues @ 2024-10-21 19:17:23

盲猜浮点数精度问题


by huanzhe @ 2024-10-23 21:51:42

#include<bits/stdc++.h>
using namespace std;
int main(){
    long long a,b;
    cin>>a>>b;
    cout<<a+b;
return 0;
}

|