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 |
恩.把RE的直接复制再提交In Reply To:哪两个提交?相同程序用相同语言交的? Posted by:hawk at 2005-09-26 23:21:27 RE: #include <stdio.h> #include <string.h> #include <iostream.h> #include <memory.h> int main() { bool onespace=false; char ch[91]; // freopen("in.txt","r",stdin); int now=0; while (scanf("%s",ch)==1) { if (strcmp(ch,"<br>")==0) {printf("\n"); now=0;} else if (strcmp(ch,"<hr>")==0) { if (now!=0) printf("\n"); printf("--------------------------------------------------------------------------------\n"); // printf("--\n"); now=0; } else { if (now!=0&&now+strlen(ch)+1>80) {printf("\n"); now=0;} else if (now==0&&now+strlen(ch)>80) {printf("\n"); now=0;} if (now==0) { now+=strlen(ch); printf("%s",ch); } else { now+=strlen(ch)+1; printf(" %s",ch); } } } printf("\n"); return 0; } //--------------------------------------------------------------------------- AC: #include <stdio.h> #include <string.h> #include <iostream.h> #include <memory.h> int main() { bool onespace=false; char ch[91]; // freopen("in.txt","r",stdin); int now=0; while (scanf("%s",ch)==1) { if (strcmp(ch,"<br>")==0) {printf("\n"); now=0;} else if (strcmp(ch,"<hr>")==0) { if (now!=0) printf("\n"); printf("--------------------------------------------------------------------------------\n"); // printf("--\n"); now=0; } else { if (now!=0&&now+strlen(ch)+1>80) {printf("\n"); now=0;} else if (now==0&&now+strlen(ch)>80) {printf("\n"); now=0;} if (now==0) { now+=strlen(ch); printf("%s",ch); } else { now+=strlen(ch)+1; printf(" %s",ch); } } } printf("\n"); return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator