Problem G: 零起点学算法102——删除字符
#include<stdio.h>
#include<string.h>
int main()
{
char ch[],a;
while(gets(ch)!=NULL)
{
scanf("%c",&a);
getchar();
getchar();
for(int i=;ch[i]!='\0';i++)
{
if(ch[i]!=a)
printf("%c",ch[i]);
}
printf("\n");
}
return ;
}
HINT
char str[],a;
while(gets(str)!=NULL)//多组测试数据
{
scanf("%c",&a);
getchar();//注意加这一行,它的作用是将上一行输入的回车符号'\n'符号读入
for(i=;str[i]!='\0';i++) {
//写代码;找到a,用循环语句将数组左移1位置
}
//写代码;输出删除a后的数组
}
return ;
}
//可能第二行的字符后面有空格或者其他的东西,建议用gets来读第二行。
//用C++的可以把gets换成getline会更好
Problem G: 零起点学算法102——删除字符的更多相关文章
- Problem G: 零起点学算法106——首字母变大写
#include<stdio.h> #include<string.h> int main(void) { ]; int i,k; while(gets(a)!=NULL) { ...
- Problem G: 零起点学算法86——Fibonacc
#include<stdio.h> int main(){ ]={,,}; ;i<=;i++) { a[i]=a[i-]+a[i-]; } scanf("%d", ...
- Problem G: 零起点学算法27——等级分制度
#include<stdio.h> int main() { int a,b; while(scanf("%d %d",&a,&b)!=EOF) +a* ...
- Problem H: 零起点学算法109——单数变复数
#include <stdio.h> #include<string.h> int main(void) { int n; ]; scanf("%d",&a ...
- Problem D: 零起点学算法95——弓型矩阵
#include<stdio.h> #include<string.h> int main() { ][]; while(scanf("%d%d",& ...
- Problem F: 零起点学算法42——多组测试数据输出II
#include<stdio.h> int main() { ; while(scanf("%d%d%d",&a,&b,&c)!=EOF) { ...
- Problem E: 零起点学算法34——3n+1问题
#include<stdio.h> #include<math.h> int main() { int n; n<=pow(,); ; scanf("%d&qu ...
- Problem K: 零起点学算法107——统计元音
#include<stdio.h> int main() { int n; ]; while(scanf("%d%*c",&n)!=EOF) { while(n ...
- Problem J: 零起点学算法105——C语言合法标识符
#include<stdio.h> #include<ctype.h>//调用isalpha函数 int main() { int n; ]; while(scanf(&quo ...
随机推荐
- Java多线程学习(四)等待/通知(wait/notify)机制
转载请备注地址:https://blog.csdn.net/qq_34337272/article/details/79690279 系列文章传送门: Java多线程学习(一)Java多线程入门 Ja ...
- Part2-HttpClient官方教程-Chapter4-HTTP 认证
原文链接地址 HttpClient 提供对由 HTTP 标准规范定义的认证模式的完全支持.HttpClient 的认证框架可以扩展支持非标准的认证模式,比如 NTLM 和 SPNEGO. 4.1 用户 ...
- perl多线程tcp端口扫描器(原创)
perl多线程tcp端口扫描器(原创) http://bbs.chinaunix.net/thread-1457744-1-1.html perl socket 客户端发送消息 http://blog ...
- C# 对后台方法事件,可以直接return; 跳出
protected void lbtButton_Click(object sender, EventArgs e) { return; } C# 对后台方法事件,可以直接return; 跳出
- golang锁记
golang中有两个锁实现 atomic的CAS实现锁 首先是inter cpu,熟悉汇编的人都知道,inter指令集有个lock,如果某个指令集前面加个lock,那么在多核状态下,某个核执行到这个前 ...
- golang中 return如果返回指针比大型struct性能高
type tt struct{ aa int bb int cc int str string } func func_rstruct () tt{ t:=tt{1,2,3,"8888888 ...
- C基础 内存统一入口
引言 - malloc 引述 C标准中堆上内存入口就只有 malloc, calloc, realloc . 内存回收口是 free. 常见的一种写法是 struct person * per = ...
- [hadoop][会装]HBase集群安装--基于hadoop ha模式
可以参考部署HBase系统(分布式部署) 和基于无HA模式的hadoop下部署相比,主要是修改hbase-site .xml文件,修改如下参数即可: <property> <name ...
- laravel 中的入口文件报错
1.此次是由于加载的配置文件的编码错误导致的.例:conf.php
- Content to Node: Self-Translation Network Embedding
paper:https://dl.acm.org/citation.cfm?id=3219988 data & code:http://dm.nankai.edu.cn/code/STNE.r ...