亚洲春色中文字幕久久久-三上亚,一吻二脱三床四吻胸,国产真实伦对白视频全集,在线毛片观看,精品成品入口黄网,国产毛aⅴ片久久久,亚洲AV色香蕉一区二区三区老师,萧皇后A级艳片,色情日本视频更新,99久久亚洲精品日本无码
標題:
C++語言刪除指定位置m后n個字符程序
[打印本頁]
作者:
daming
時間:
2014-12-30 02:05
標題:
C++語言刪除指定位置m后n個字符程序
本帖最后由 daming 于 2014-12-30 02:16 編輯
#include<iostream.h>
class str
{
private:
char *p;
int m,n;
public:
str(char a[])
{
p=a;
cin>>m>>n;
}
int strdel()
{
int i=0,j=0;
while(p[i++]);
i--;
if(m+n>i)
return 0;
else{
i=m;
j=m+n;
while(p[j])
p[i++]=p[j++];
p[i]=0;
return 1;
}
}
void print()
{
if(strdel()==1) //調用了 strdel 一次
cout<<"1"<<endl
<<p<<endl;
else
cout<<"0"<<endl;
}
};
void main()
{
char a[10];
cin>>a;
str A(a);
A.print();
}
復制代碼
歡迎光臨 (http://www.denmoz.com/bbs/)
Powered by Discuz! X3.1