December 22, 2018
Prime factors
Threads: Input 1 number, analysis of which achievement of the prime factors.
Input: A positive integer.
Output: Integrated chain of alternating prime factors by commas *. Factors Descending.
For example:
input: 6 output: 2*3
You are not logged in? Log in to Submit Now!
14 Comments
Add a Comment
You must be logged in to post a comment.
What is processing? ?
ah, I'm sure the system is handling you then. Maybe due to many submissions, processing is slow.
The code is wrong
NZEC laf ntn ad
Probably no output ko.
Please advise 1 little. The teacher's explanation after I submitted it:
if(n > 1) printf(“*”);
Must be:
if(n > i) printf(“*”);
it's more correct
In this TH it's the same, Because when it gets bigger 1 then you can definitely multiply, so print the sign *.
Total error “Time Limit Exceeded” what is it, admin?
Running time is over. You should check the instructions before you do it.
Admin, please look at my work, why do I get Runtime error 207 yes
I got an error File size limit exceeded what is it
the code is too heavy.
#include
using namespace std;
long long n;
int main(){
ios::sync_with_stdio(0), cin.tie(NULL), cost.(NULL);
China>>n;
long long i=2;
while(n){
cost<<"*";
bool kt=0;
while(n%i==0){n/=i; kt=1;}
if(kt) cost<<i;
}
}
Compared to many articles on the web, this one is still quite light nhẹ
oh why is there? 4/5 Thus ad, test number 5 where