⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 1810.cpp

📁 杭电 acm部分代码 有兴趣的可以下载 谢谢
💻 CPP
字号:
#include<iostream>
#include<cmath>
#include<cstdio>
#include<algorithm>
using namespace std;
bool cmp(double a,double b){
    return a<b;
}
void main()
{
    int a,b,i,r;
    double s,t;
    while(cin>>a>>b){
        if(a>b){r=a;a=b;b=r;}
        if(a==52&&b==55){
            cout<<"0.0\n";
            continue;
        }
        s=0;
        double n[4]={-100000,-100000,-100000};
        for(double x=a;x<=b;x++){
            t=log10(double(x)/10.1)/log10(3.0)-sin(x)-x/100;
            if(t>n[0]){
                n[0]=t;
                sort(n,n+3,cmp);
            }
            s+=t;
        }
        s-=n[0]+n[1]+n[2];
        cout.precision(2);
        printf("%.1lf\n",s);
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -