參考代碼:
#include<stdio.h>
intmain()
{inti,s;
intsum(inti);
s=sum(10);
printf("s=%d\t",s);
}
intsum(intj)
{
if(j>1)
returnj+sum(j-1);
else
returnj;
}
參考代碼:
#include<stdio.h>
intmain()
{inti,s;
intsum(inti);
s=sum(10);
printf("s=%d\t",s);
}
intsum(intj)
{
if(j>1)
returnj+sum(j-1);
else
returnj;
}