文章搜索:
      
当前位置:求职指导>名企资料>IT/电信>Microsoft(微软)> MSRA笔试题5(A卷)

MSRA笔试题5(A卷)

发布时间:2007-11-28 点击:
#include <stdio.h>
#include <string.h>
int FindSubString(char* pch)
{
int count=0;
char* p1=pch;
while(*p1!=''\0'')
{
if(*p1==p1[1]-1)
{
p1++;
count++;
}
else
{
break;
}
}
int count2=count;
while(*p1!=''\0'')
{
if(*p1!==p1[1]+1)
{
p1++;
count2--;
}
else
{
break;
}
if(count2==0)
{return count;
return 0;
}
void ModifyString(char* pText)
{
char* p1=pText;
char* p2=p1;
while(*p1!=''\0'')
{
int count=FindSubString(p1);
if(count>0)
{
*p2++=*p1;
sprintf(p2,"%i",count);
while(*p2!=''\0'')
{
p2++;
}
p1+=count+count+1;
}
else
{
*p2++=*p1++;
}
}
void main(void)
{
char text[32]="XYBCDCBABABA";
ModifyString(text);
printf(text);
}
In the main() function, after ModifyString(text) is called, what''s the value
of ''text''?
Tag:
上一篇:没有了
下一篇: MSRA的笔试题2(A卷)
推荐文章
求职视频推荐
应聘时,如何谈薪水呢
应聘时,如何谈薪水呢
今天我们怎样找工作
今天我们怎样找工作
求职资料下载推荐
关于我们 | 联系我们 | 加入我们 | 友情链接 | 合作伙伴 | 广告合作 | 帮助中心 | 网站地图
© 2007-2008 CopyRight 54YJS.cn 我是应届生 粤ICP备07037529号