#include
long fun (int a, int n)
{ int j ;
/**************found**************/
long s = 0, t = 0 ;
for ( j = 0 ; j < n ; j++)
t = t * 10 + a ;
s = t ;
for ( j = 1 ; j < n ; j++) {
/**************found**************/
t = t / 10 ;
s = s - t ;
}
return(s) ;
}
long main( )
{ int a, n ;
printf( "\nPlease enter a and n:") ;
scanf( "%d%d", &a, &n ) ;
printf( "The value of function is: %ld\n", fun ( a, n ) );
}
linux gdb 或者 vs的单步调试 请了解一下
要看你输入的是什么数,你多试几组数
你在子函数里面是有问题的吧