主要是static静态变量的使用
int func(int a,int b)
{
static int times=0;
times++;
if(times==1)
{
if(a>b)
return a;
if(a<b)
return b;
}
if(times==2)
{
if(a>b)
return b;
if(a<b)
return a;
}
if(times==3)
{
return a+b;
}
}
主要是static静态变量的使用
int func(int a,int b)
{
static int times=0;
times++;
if(times==1)
{
if(a>b)
return a;
if(a<b)
return b;
}
if(times==2)
{
if(a>b)
return b;
if(a<b)
return a;
}
if(times==3)
{
return a+b;
}
}