| ||||||||||
| 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 | |||||||||
gets( ) WA , cin AC 为什么呢?嚎#include <iostream>
using namespace std;
int main()
{
int n1,i,j;char c[1000],p;
cin>>n1;
for(int k=0;k<n1;k++)
{
cin>>c;/////改成gets就WA
j=1;
for(i=1,p=c[0];i<strlen(c);i++)
if(c[i]==p)
j++;
else
{
cout<<j<<(int)p-48;
j=1;
p=c[i];
}
cout<<j<<(int)p-48<<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