3 2 5 7Sample Output12
70
我的代码是:
#include
#include
int main(void)
{
int max(int *a)
{
int m;
for(m=*a;*a!=0;a++)
if(*a>=m)
{m=*a;}
printf("%d\n",m);
return m;
}
int num,i,j,count,a[100];
while(scanf("%d",&num)!=EOF)
{
for(i=0;i
j=max(a);
while(j++)
{
count=0;
for(i=0;i
if(count==num)
break;
}
printf("%d\n",j);
}
}