ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1049. Brave Balloonists

Please tell me why I got compilation error??
Posted by Pai.tu64[th] 4 Oct 2002 20:20
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??
Posted by Stupnikov Pavel 8 Jul 2003 21:44
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.