我不知道怎么改了🌚下面是代码:
#include
using namespace std;
int main()
{int s,t;
cin>>s>>t;
int a[]={1,2,5,10,20,50,100,200,500,1000,2000,5000,10000};
double h;
int k=12,w=0;
for(int i=s;i<=t;i++)
{
int flag=0,b=0;
for(k=12;i!=0;k--){
b=i/a[k];
i=i%a[k];
flag=flag+b;
}
w=w+flag;
} h=w/(t-s+1);
cout<<h<<endl;
return 0;
}