char *itoa( const int num ,char* buf, const int ignore )
{
const char table[] = "0123456789";
char *p = buf;
int tmp;
for(tmp=num;tmp>0;tmp /= 10) *p++;
*p='\0';
for(tmp=num;tmp>0;tmp /= 10) *--p=table[tmp%10];
return buf;
}
int main()
{
char buf[99];
int aho;
for(aho=1; aho<50; aho++){
if( aho%3==0 || aho%5==0 ||
strchr(itoa(aho,buf,10),'3')) printf("%d\n",aho);
}
return 0;
}