鱼C论坛

 找回密码
 立即注册
查看: 3163|回复: 9

大神路过

[复制链接]
发表于 2016-6-29 22:08:02 | 显示全部楼层
回复
  1. #include<stdio.h>
  2. #include<string.h>
  3. int main()
  4. {
  5.         char del;
  6.         char mystr[]="abcd";
  7.         int i=strlen(mystr),j=0;
  8.         printf("please input a char\n");
  9.         del=getchar();
  10.         for(j=0;j<i;j++)
  11.         {
  12.                 if(del==mystr[j])
  13.                 {
  14.                         for(;j<i;j++)
  15.                         {
  16.                                 mystr[j]=mystr[j+1];
  17.                         }
  18.                         break;
  19.                 }
  20.         }
  21.         puts(mystr);
  22.        
  23.         return 0;
  24. }
复制代码
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-11-3 08:44

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表