|
|
back to boardPlease tell me why I got compilation error?? Here is my C code #include <stdio.h> #include <string.h> unsigned int primefac[10000]={{0}}; int count=1,maxfac=2; void getprimefac(long n) { long i; for(i=2;n != 1;i++){ while(n%i == 0){ primefac[i]++; n/=i; if(i > maxfac) maxfac = i; } } } void printans() { char temp[10]; itoa(count,temp,10); strrev(temp); temp[1] = 0; printf("%s",temp); } void calculate() { long i; for(i=2;i<=maxfac;i++) if(primefac[i]) count*=primefac[i]+1; } int main(void) { long i,a; primefac[1] = 1; for(i=0;i<10;i++){ scanf("%ld",&a); getprimefac(a); } calculate(); printans(); return 0; } Re: Please tell me why I got compilation error?? You tried to solve problem 1049. Your solution on C++ was compiled with the following errors: 410736 temp\410736(23) : error C2065: 'itoa' : undeclared identifier for itoa #include <stdlib.h> Select "To My E-mail adress" when you submit your programs. They write full description. |
|
|