ALL TLE
查看原帖
ALL TLE
955228
OIer_xhy楼主2024/12/6 20:21
#include<bits/stdc++.h>
#define ll long long
using namespace std;

signed main()
{
	int n;
	cin>>n;
	int t=2; 
	while(n!=1&&t<=n){
		if(n%t!=0) t++;
		else{
			int sum=0;
			while(n%t==0) sum++,n/=t;
			cout<<t;
			if(sum!=1) cout<<"^"<<sum;
			if(n!=1)cout<<" * ";
		}
	}
    return 0;
}


人都麻了

2024/12/6 20:21
加载中...