#包含
结构nes
{
char name[21];
int num;
(ST; /* st全局结构变量*
voidinput(structnes*ST ); /*函数原型/
voidshow_nes(structnes*ST ); /*函数原型/
----------------/
//Main //
//--------//
入主(void ) )。
{
打印(input : (n ) );
输入(ST;
打印(show : (n ) );
show_nes(ST;
getchar (;
返回0;
}
----------------/
//函数/
//--------//
voidinput(structnes*ST ) )
{
printf ('请输入您的ID和名称。 (请用空格隔开间隔。 (n );
wile(Scanf('%ds ',st-num,st-name )!=2)
{
getchar (获取)!='n ';
printf ('请按照要求正确输入! n ';
}
getchar (获取)!='n ';
}
voidshow_nes(structnes*ST ) )。
{
printf(%d%s(n ),st-num,st-name );
}
[此帖子已在2007-11-9 0:20:37中编辑]