Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int a[20];
- int i,j,k,n,m,temp;
- scanf("%d",&n);
- if(n==0)
- printf("10\n");
- else if(n<10)
- printf("%d\n",n);
- else{
- m=0;
- for(i=9;i>=2;i--)
- while(n%i==0)
- {
- n=n/i;
- m++;
- a[m]=i;
- }
- if(n>1)
- printf("-1\n");
- else{
- for(j=1;j<=m;j++){
- for(k=j+1;k<=m;k++){
- if(a[j]>a[k]){
- temp=a[j];
- a[j]=a[k];
- a[k]=temp;
- }
- }
- }
- for(j=1;j<=m;j++)
- printf("%d",a[j]);
- printf("\n");
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement