Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

我也想问。都让我挤到for里了

Posted by alpc62 at 2007-08-14 19:34:16 on Problem 3339
In Reply To:这题有什么比较方便的方法读数据么? Posted by:kansas at 2007-08-14 17:10:24
struct zh
{
...
}a[23];

int wei(char x)
{
...
}

int year(char *x)
{
...
}

for (;memset(a,0,sizeof(a)),scanf("%d",&a[1].num),a[1].num;printf("\n"))
{
	for (i=1;i<=22;i++)
	{
		if (i!=1)	scanf("%d",&a[i].num);
		scanf(" %s %c",&a[i].s,&c);
		a[i].w=wei(c);
		for (;scanf("%c",&c),c==' ';a[i].t+=year(cc))	scanf("%s",&cc);
	}
...
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator