| ||||||||||
| 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 | |||||||||
判断长度差一的字符串能否转化为另一个。int Near(char *s,char *t,int l)
{//lens - lent == 1 ; s[] to t[]
int c,i;
for(i=c=0;i<l&&c<2;){
if(s[i+c]!=t[i])
c++;
else i++;
}
return 2-c;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator