sun_siliang 采纳率:52% 来自团队:C* 擅长: C/C++ VC++ VB 安全软件 数据库DB 其他回答 定义一个字符串数组,然后用for语句循环,找到你要删除的那个字符,删除后就退出循环。 menghuahewei | 发布于2011-11-01 举报| 评论 2 0 为您推荐: c语言程序设计 c语言 字符串 c语言隐藏字符串 c 字符...
定义一个字符串数组,然后用for语句循环,找到你要删除的那个字符,删除后就退出循环。
include <stdio.h> include <string.h> void main(){ char ch[20];int n,i,len;printf("输入一个字符串:");gets(ch);printf("要删除字符的位置:");scanf("%d",&n);len=strlen(ch);for(i=n-1;i<len;i++)ch[i]=ch[i+1];printf("删除后的字符串:");puts(ch);printf("\n...
include <iostream>#include <algorithm>#include <string>using namespace std;int main(){ string pre_str; cin>>pre_str; int i; cout<<"Enter pos"; cin>>i; remove(pre_str.begin(),pre_str.end(),pre_str[i+1]); for(int j=0;j<pre_str.length()-2;...