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

这样来处理输入行不行?

Posted by majia315 at 2005-12-18 17:58:26 on Problem 1805
	int q=0; 

	scanf("%d", &q);
	
	char ghgh;
	
	scanf("%c", &ghgh);

	int j=1;

	while(q--)
	{
		char n[10000];

		char m[100][100];

		int ee=0; 
		
		ghgh=2;



		while(ghgh!='\n')
		{
		   scanf("%c", &ghgh);
		   n[ee]=ghgh;
		   ee++;
		}

		n[ee-1]='\0';

		int r=0; int h=0;

		for(int t=0; ; t++)
		{
			if(n[t]=='\0')
			{
				m[r][h]='\0';
				break;
			}
			else
			{
			  if(n[t]==' ')
			  {
				m[r][h]='\0';
				r++; h=0;
			  }

			  else
			  {
		      m[r][h]=n[t];
			   h++;
			  }
			}
		}

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