c++第六次作业
来源:互联网 发布:js脚本代码 编辑:程序博客网 时间:2024/06/09 14:06
一.问题及代码/** 文件名称:字符删除* 作 者: 彭梓铖* 完成日期: 2017 年 5月 19 日* 版 本 号:v1.0* 对任务及求解方法的描述部分:* 输入描述:* 问题描述:* 程序输出: 三角形空心* 问题分析:* 算法设计:*/#include<iostream>using namespace std;int main(){ char s[]="Hello the World"; char *p,*q,c; cin>>c; p=s; q=s; while(*p!='\0') { if(*p!=c) *q++=*p; p++; } *q='\0'; cout<<s; return 0;}/** 文件名称:字符串操作* 作 者: 彭梓铖* 完成日期: 2017 年 5月 19 日* 版 本 号:v1.0* 对任务及求解方法的描述部分:* 输入描述:* 问题描述:* 程序输出: 三角形空心* 问题分析:* 算法设计:*/#include<iostream>#include<string.h>using namespace std;int main(){ char s[100],q[100]; cin>>s>>q; if(strcmp(s,q)==0) cout<<"相等"<<endl; else cout<<"不相等"<<endl; cout<<s<<q; return 0;}
阅读全文
0 0
- C程序设计第六次课后作业
- C++——第六次作业。
- C语言第六次作业练习
- 第六次作业
- 第六次作业
- 第六次作业
- 第六次作业
- 第六次作业
- 第六次作业
- 第六次作业
- 第六次作业
- 第六次作业
- 第六次课后作业
- 第六次课后作业
- 第六次课后作业
- 第六次课后作业
- 第六次作业
- 第六次课堂作业
- POM文件中配置了ReportNG监听器后,找不到配置文件了??报空指针
- Attack
- Problem B (BFS)
- Spring 4 @PropertySource和@Value注解示例
- 如何正确使用开源项目?
- c++第六次作业
- 实验6
- CF799D:Field expansion(dp)
- Linux命令基础39-apt-get命令
- jquery 模块拖拽功能的实现
- 附加依赖项值的快速求取(opencv+vs)
- opencv 图像融合(局部处理)
- CentOs将yum源换为阿里源
- 递归实现字符串反转