提交时间:2025-03-28 18:46:57

运行 ID: 8195

#include <bits/stdc++.h> using namespace std; int main(){ int n,m; cin>>n>>m; for (int i = n;i<=m;i++){ int d = 0; for (int j = 2;j<i;j++){ if (i % j == 0){ d = 1; break; } } if (d == 0){ cout<<i<<"="<<i<<endl; } else{ cout<<i<<"="; int k = 2; int c = i; while (1){ while (c % k == 0){ cout<<k; c = c / k; if (c != 1) cout<<"*"; } if (c == 1) { cout<<endl; break; } k++; } } } return 0; }