摘要: C++ STL====Standard Template Library C++ 标准模板库,即 C++泛型库它在std命名空间中定义了常用的数据结构和算法C++ STL提供了三种类型的组件-----容器 迭代器 算法1 .容器 a----顺序容器是一系列 元素 的 有序集合-----vector ... 阅读全文
posted @ 2014-07-30 17:41 2014acm 阅读(107) 评论(0) 推荐(0) 编辑
摘要: ---出现问题--- 一个getline和cin.geline这两个函数的区别:这两个函数同时是存储一个句子,用getline函数时,当输入一个字符串时,要敲两下回车,这个语句才结束,而用cin.getline则不用:#include #include using namespace std;mai... 阅读全文
posted @ 2014-07-30 13:27 2014acm 阅读(4811) 评论(0) 推荐(1) 编辑
摘要: #includeusing namespace std;int main(int argc, char *argv[]){ string s; cin>>s; cout#includeusing namespace std;int main(int argc, char *argv[]){ ... 阅读全文
posted @ 2014-07-30 13:16 2014acm 阅读(1671) 评论(0) 推荐(0) 编辑
摘要: 头文件:#include gets()函数用于从缓冲区中读取字符串,其原型如下: char *gets(char *string);gets()函数从流中读取字符串,直到出现换行符或读到文件尾为止,最后加上NULL作为字符串结束。所读取的字符串暂存在给定的参数string中。【返回值】若成功则返回... 阅读全文
posted @ 2014-07-30 13:03 2014acm 阅读(318) 评论(0) 推荐(0) 编辑
摘要: 函数名: gets 功 能: 从流中取一字符串 用 法: char *gets(char *string); 程序例: #include int main(void) { char string[80]; printf("Input a string:"... 阅读全文
posted @ 2014-07-30 13:00 2014acm 阅读(227) 评论(0) 推荐(0) 编辑
摘要: gets的用法gets【1】函数:gets【2】头文件:stdio.h【3】功能:从stdin流中读取字符串,直至接受到换行符或EOF时停止,并将读取的结果存放在str指针所指向的字符数组中。换行符不作为读取串的内容,读取的换行符被转换为null值,并由此来结束字符串。【4】注意:本函数可以无限读取... 阅读全文
posted @ 2014-07-30 12:56 2014acm 阅读(1011) 评论(0) 推荐(0) 编辑
摘要: C语言 gets()和scanf()函数的区别scanf( )函数和gets( )函数都可用于输入字符串,但在功能上有区别。若想从键盘上输入字符串"hi hello",则应该使用__gets__函数。gets可以接收空格;而scanf遇到空格、回车和Tab键都会认为输入结束,所有它不能接收空格。ch... 阅读全文
posted @ 2014-07-30 12:54 2014acm 阅读(165) 评论(0) 推荐(0) 编辑