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 ...
随机推荐
- xctf一道反序列化题
题目地址:http://120.24.86.145:8006/test1/ 右键get源码: <?php $user = $_GET["txt"]; $file = $_GE ...
- skb管理函数之skb_clone、pskb_copy、skb_copy
skb_clone--只复制skb描述符本身,如果只修改skb描述符则使用该函数克隆: pskb_copy--复制skb描述符+线性数据区域(包括skb_shared_info),如果需要修改描述符以 ...
- BZOJ 4241: 历史研究——莫队 二叉堆
传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=4241 题意:N个int范围内的数,M次询问一个区间最大的(数字*出现次数)(加权众数),可以 ...
- jquery - 实例1
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="text2.aspx.cs& ...
- JS监控手机或APP返回事件
做微信项目的时候,发现在Ios微信浏览器左上角有个返回按钮,但是点击返回时不稳定,跳到不该跳的页面.网上搜了一个捕获返回事件的JS代码,记录下来,便于以后查看. <span style=&quo ...
- 去掉a标签的虚线框,避免出现奇怪的选中区域
a{blr:expression(this.onFocus=this.blur())}/*去掉a标签的虚线框,避免出现奇怪的选中区域*/
- linux下运行jmeter脚本
1. win下生成测试计划 2. 上传至linux下 3.运行测试计划 sh jmeter.sh -n -t second_login.jmx -l res.jtl 错误1: solution ...
- Python在线教程
Python 3.x的 http://www.ziqiangxuetang.com/python3/python3-stdlib.html 廖雪峰的官方网站 http://www.liaoxuefen ...
- Math.random易于记忆理解
产生随机数 Math.random*(Max-Min)+Min
- poj 1426(同余搜索)
Find The Multiple Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 26926 Accepted: 111 ...