|
|
back to boardCan anyone help me When I run this program its giving correct answer for me but its fails in the Test#1 itself. can anyone point where the wrong has been. #include<stdio.h> int main() { long input; int output[100]; int i,j=0; scanf("%ld",&input); if (input==0) { printf("10"); return 1; } if (input<10) { printf("%d",input); return 1; } while (input>9) { for(i=9;i>1;i--) { if(input%i == 0) { output[j]=i; printf("%d\n",i); j++; input/=i; break; } } if(i==1) { printf("-1"); return 1; } } output[j]=input; for(i=j;i>=0;i--) { printf("%d",output[i]); } return 1; } Re: Can anyone help me for n with prime divisor more than 7 it will be loop,for example 11. |
|
|