简洁的错误代码,崩溃的OI学生
查看原帖
简洁的错误代码,崩溃的OI学生
1451441
Mii2308楼主2025/2/7 19:44

求调

#include<iostream>
using namespace std;
int n;
typedef long long ll;
int main(){
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);std::cout.tie(0);
	cin>>n;
	for(int i=1;i<=n;i++){
		ll t;cin>>t;ll q=t;
		for(ll j=2;j*j<=t;j++){
			while(q%j==0){
				q/=j;cout<<j<<" ";
			}
			if(q!=1) cout<<q;
		}
		cout<<"\n";
	}
	return 0;
}
2025/2/7 19:44
加载中...