- 博客(9)
- 收藏
- 关注
转载 老师把我的源程序改了哪些地方?
修改前后的源代码分别保存成2个word文档,如before.docx和after.docx,然后用word自动比较。比较方法见下:如何比较两个word文档的差异_百度经验 https://jingyan.baidu.com/article/215817f7ced9801eda1423d9.html...
2018-10-20 11:24:34 339
原创 单链表实现集合的并、交、差运算
带头结点的单链表实现集合的并、交、差运算。#include <iostream> //引用输入输出流库函数的头文件using namespace std;template <class T>struct Node{ T data; Node<T> *next; //此处<T>也可以省略};template <cl...
2018-10-24 17:48:34 12091
原创 定义顺序表类,表示集合,实现求集合的并(C++)
定义顺序表类,表示集合,实现求集合的并。#include <iostream>using namespace std;const int MaxSize=100; //100只是示例性的数据,可以根据实际问题具体定义template <class T> //定义模板类SeqListclass SeqList{public: SeqList...
2018-10-19 12:10:09 1889
原创 设计包含静态数据成员的Student类
设计包含静态数据成员的Student类,在该类定义中包括:数据成员:学号,年龄,分数score,及静态数据成员学生人数count;定义成员函数用于设置和读取及显示学号,年龄,分数,累计学生人数;静态成员函数getCount( ) 用于返回总人数;外部函数average()用于求平均值。在main函数中,输入某班同学的成绩,并调用上述函数求全班学生的平均分。 #include &...
2018-10-19 11:27:31 5375 1
转载 C++中的cin、cin.get()、cin.getline()、getline()、gets()等函数的用法
1、cin2、cin.get()3、cin.getline()4、getline()5、gets()6、getchar()1.cin>>用法1:最基本,也是最常用的用法,输入一个数字:#include <iostream>using namespace std;main (){int a,b;cin>>a>...
2018-10-19 11:24:40 550
原创 C++中的tab(\t)
#include <iostream>using namespace std; int main() { int i; for(i=0;i<80;i++) if(i%10==0)cout<<i/10; else cout<<' ';for(i=0;i<80;i++) cout<<i%...
2018-10-19 10:11:19 9761
原创 C++中的退格(\b)
#include <iostream> using namespace std; int main() { cout << "abcde\b"<<"123"<<endl; cout << "abcde\b\b\b"<<&q
2018-10-19 10:09:57 9787 5
原创 C++中的回车(\n)和换行(\r)
‘\n’ 换行,光标移到下一行的开头;'\r' 回车,光标移到当前行的开头,不会换到下一行,如果接着输出的话,本行以前的内容会被逐一覆盖;#include <iostream> using namespace std; int main() { cout << "this is the first line\n"; c...
2018-10-19 10:07:48 29923 1
原创 c++ 读入一个字符
#include <iostream>using namespace std;int main(){ char c; cin>>c; //自动过滤掉不可见字符(如空格 回车 tab等),这些字符被当作间隔符号,输入不可见字符不识别 cout <<c<<" "<< c %2<< endl;
2018-10-15 11:31:55 11286
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人