满意答案
sd316122279
2014.02.19
采纳率:46% 等级:12
已帮助:3648人
#include
long userLogin(char *userName);
int main(void)
{
/*********Found************/
char *userName31=new char[31];
long curUserCnt = 0;
while (1)
{
printf("user %ld, input your Name: ", curUserCnt+1);
scanf("%s", userName31);
curUserCnt = userLogin(userName31);
}
return 0;
}
long userLogin(char *userName)
{
/*********Found************/
static long userNum = 0;
userNum++;
printf("welcome user %s. There have %ld users in system.\n",
userName, userNum);
/*********Found************/
return userNum ;
}
02分享举报