5-9.cpp
来自「为C++学习者」· C++ 代码 · 共 26 行
CPP
26 行
#include<iostream.h>
#include<string.h>
#define LEN 6
void del_str(char a[],char b[],int n)
{
int i,j=0;
for(i=0;i<6;i++)
if(i!=n)
{
b[j]=a[i];
j++;
}
}
void main()
{
void del_str(char a[],char b[],int n);
char str1[LEN],str2[LEN];
int n;
cout<<"enter the string:";
cin>>str1;
cout<<"enter the poisition of the string delete:";
cin>>n;
del_str(str1,str2,n);
cout<<"the new string is :"<<str2;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?