提交时间:2021-06-19 19:47:20
运行 ID: 20694
#include<bits/stdc++.h> using namespace std; double a,b,a1=1,b1=1,sum,sum1,sum2,sum3,sum4,sum5; int main(){ cin>>a>>b; for(int i=1;i<a;i++) a1*=2; for(int i=1;i<=b;i++) b1*=2; sum=b1-a1; sum1=sum;sum2=sum;sum3=sum;sum4=sum;sum5=sum; if(sum<=100000) cout<<sum; else{ while(sum1>=1000){ sum1/=10; floor(sum1); } sum1=floor(sum1); sum2/=1000; sum2=floor(sum2); sum2*=1000; cout<<sum1<<","<<sum-sum2; } }