标签:namespace code mat end i++ ref ISE 基础 tcp
#include<iostream>
#include<vector>
#include<set>
#include<math.h>
using namespace std;
vector<multiset<int> > vi(10001);
int main(){
int a, b;
cin>>a>>b;
for(int i=2; i<=10000; i++){
int flag=0;
for(int j=2; j<=sqrt(i); j++){
if(i%j==0){
flag=1;
vi[i].insert(vi[j].begin(), vi[j].end());
vi[i].insert(vi[i/j].begin(), vi[i/j].end());
break;
}
}
if(flag==0)
vi[i].insert(i);
};
for(int i=a; i<=b; i++){
cout<<i<<"=";
for(multiset<int>::iterator it=vi[i].begin(); it!=vi[i].end(); it++)
if(it==vi[i].begin()) cout<<*it;
else cout<<"*"<<*it;
cout<<endl;
}
return 0;
}
标签:namespace code mat end i++ ref ISE 基础 tcp
原文地址:https://www.cnblogs.com/A-Little-Nut/p/10354052.html