akoj-1189-字符串去特定字符
来源:互联网 发布:淘宝如何设置两个客服 编辑:程序博客网 时间:2024/06/11 02:41
字符串去特定字符
Time Limit:1000MS Memory Limit:65536K
Total Submit:42 Accepted:11
Description
输入字符串s和字符c,要求去掉s中所有的c字符,并输出结果。
Input
测试数据有多组,每组输入字符串s和字符c。
Output
对于每组输入,输出去除c字符后的结果。
Sample Input
healloa
Sample Output
hello
Source
#include<cstdio>#include<cstring>#include<iostream>using namespace std;int main(){ char s[1001],b[1001],c; int len,i; while(scanf("%s",s)!=EOF) { getchar();//不要忘了 len=strlen(s); scanf("%c",&c); for(i=0; i<len; i++) { if(s[i]==c) b[i]=0; else b[i]=1; } for(i=0; i<len; i++) { if(b[i]==1) cout<<s[i]; } cout<<'\n'; } return 0;}
0 0
- akoj-1189-字符串去特定字符
- 1189 -- 字符串去特定字符
- 字符串去特定字符
- 字符串去特定字符
- 字符串去特定字符
- 字符串去特定字符
- 题目1160: 字符串去特定字符
- 题目1049:字符串去特定字符
- 题目1049:字符串去特定字符
- 题目1049:字符串去特定字符
- 题目1049:字符串去特定字符
- 题目1049:字符串去特定字符
- 题目1049:字符串去特定字符
- 九度1049:字符串去特定字符
- 题目1049:字符串去特定字符
- 题目1049:字符串去特定字符
- 九度oj 1049 字符串去特定字符
- 九度OJ 1049 字符串去特定字符
- 通过PowerShell获取TCP响应(类Telnet)
- 自旋锁和互斥锁
- 输入一串数字,求比这个数大的下一个回文数
- DragonBones for Cocos2d-x
- HDU 4709 Herding
- akoj-1189-字符串去特定字符
- 快排
- 单例模式
- 表格框架(frame)属性
- python复习过程遗漏知识
- 类和对象第三讲
- android ConextMenu
- GCD串行队列
- Vijos P1881 闪烁的繁星 (自己加强了一下。。)