Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
谈谈输入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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator