求助,24pts
查看原帖
求助,24pts
320470
William_Takazaki楼主2022/11/5 16:36
#include<bits/stdc++.h>
using namespace std;
int n,x,a[5],m;
int main(){
	cin>>n;
	while(n!=0){
		x=sqrt(n);
		m++;
		a[m]=x;
		n-=x*x;
	}reverse(a+1,a+1+4);
	for(n=1;n<=4;n++)cout<<a[n]<<" ";
	return 0;
}
2022/11/5 16:36
加载中...