1101 B是A的多少倍 较简单
作者:互联网
代码
#include <iostream>
#include <cstdio>
#include <string>
#include <iomanip>
using namespace std;
int main()
{
string a;
int d;
string b;
cin>>a>>d;
d=a.size()-d;
b=a;
for(int i=0;a[i]!=NULL;i++){
if(i+d<=a.size()-1){
b[i]=a[i+d];
}
else{
b[i]=a[i-a.size()+d];
}
}
cout<<fixed<<setprecision(2)<<(stof(b)/stof(a));
return 0;
}
标签:std,main,string,int,1101,NULL,多少倍,简单,include 来源: https://www.cnblogs.com/wodeblog1982/p/16480239.html