蒟蒻35分求教
查看原帖
蒟蒻35分求教
302967
蒟蒻Ken_bruce楼主2020/9/2 18:20
#include <bits/stdc++.h>
using namespace std;
int size(int n){
	int k=0;
	while(n){
		n/=10;
		++k;
	}
	return k;
}
int main(){
	long long a,ans=1;
	long long b;
	cin>>a>>b;
	if(a<=18)
	{
		for(int i=1;i<=a;i++)
			ans*=10;
		ans+=b;
		printf("%lld",ans);
		return 0;
	}
	else
	if(b!=0){
		cout<<1;
		for(int i=1;i<=a-size(b);i++) cout<<"0";
		cout<<b;
	}
	else for(int i=1;i<=a;i++) cout<<"0";
} 

我当时就在想,做不出来我就不是我!现在看,果真不是我QwQ

2020/9/2 18:20
加载中...