1 条题解

  • 1
    @ 2023-4-1 20:44:56
    #include<iostream>
    using namespace std;
    int n,m;
    void paint(int x){
    	cout<<x<<"=";
    	a:;
     	for(int i=2;i<=x;i++){
    		if(x%i==0){
    			cout<<i;
    			x/=i;
    			if(x!=1){//如果不是最后一个因数
    				cout<<"*";
    				goto a;//回到a的位置
    			}
    		}
    	}
    	cout<<endl;
    }
    int main(){
    	cin>>n>>m;
    	for(int i=n;i<=m;i++)paint(i);
    	return 0;
    }
    
    • 1

    信息

    ID
    976
    时间
    1000ms
    内存
    128MiB
    难度
    10
    标签
    递交数
    6
    已通过
    6
    上传者