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 040940129 at 2012-04-09 19:41:38 on Problem 2503
typedef struct node{
            char *orig;
            char *tran;
}Word;
char init[30],*ch;

while(gets(init) && init[0]!='\0'){
		word[n].orig=(char *)malloc( 15 *sizeof(char));
		word[n].tran=(char *)malloc( 15 *sizeof(char));
		ch=strstr(init," ");
		addres = ch - init;
		strcpy(word[n].orig,&init[addres+1]);
		init[addres]='\0';
		strcpy(word[n++].tran,init);
}

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