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 |
不知道为什么WA#include <iostream> #include <stdio.h> using namespace std; int main() { int n,data[1100],i,sum,j; char str[1100]; while(scanf("%d",&n)!=EOF) { while(n--) { scanf("%s",str); for(i=0,j=0;i<strlen(str);i++,j+=2) { data[j+1]=str[i]-'0';sum=1; while(str[i]==str[i+1]) { sum++;i++; } data[j]=sum; } for(i=0;i<j;i++) cout<<data[i]; cout<<endl; } } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator