文章

1

粉丝

27

获赞

1

访问

395

头像
正整数分解质因数 题解:
P1885 武汉大学机试题
发布于2023年8月9日 20:03
阅读数 395

#include<bits/stdc++.h> 
using namespace std;
int main(){
    int n;
    while(cin>>n){
        int a=n;
        for(int i=2;i<n;i++){
            if(n%i==0){
                cout<<i;
                n/=i;
                i--;
                if(n!=1)
                    cout<<'*';
            }
        }
        if(a==n)
            conti...

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发