- 博客(10)
- 收藏
- 关注
原创 从cin读入一组词并把它们存入一个vector对象,然后设法把所有词都改写为大写,输出改变后的结果
#include "stdafx.h" #include <iostream> #include <vector> #include <string> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { string s1; cout << "输入一组词:"; vecto...
2018-03-23 21:17:52 857
原创 读入一个包含标点符号的字符串,将标点符号去除后输出字符串剩余的部分
读入一个包含标点符号的字符串,将标点符号去除后输出字符串剩余的部分#include "stdafx.h" #include <iostream> #include <string> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { string s; cout << "请输入一段字符...
2018-03-23 19:58:30 1556
转载 C++读写二进制文件
C++读写二进制文件#include "stdafx.h" #include <iostream> using namespace std; #include <fstream> //读写二进制文件 struct Student //里面不能写string { char name[30]; char sex; float math; float chinese...
2018-03-03 14:47:17 379
转载 C++读写文本文件
C++读写文本文件#include "stdafx.h" #include <iostream> using namespace std; #include <fstream> //读写文本文件 int _tmain(int argc, _TCHAR* argv[]) { fstream ifs("src.txt", ios::in); if (!ifs) co...
2018-03-03 14:43:27 197
原创 文件输入输出ifstream ofstream fstream
ifstream ofstream fstream#include "stdafx.h" #include <iostream> using namespace std; #include <fstream> int _tmain(int argc, _TCHAR* argv[]) { ifstream ifs("aa.c"); //ios::in if (!ifs...
2018-03-03 14:42:29 282
转载 IO对象的相关属性与操作
IO对象的相关属性与操作#include "stdafx.h" #include <iostream> using namespace std; #include <fstream> //IO 对象不可复制或赋值 //void func(fstream fs) //{ // //} void func(fstream& fs) { } int _tma...
2018-03-03 14:40:46 312
转载 C++标准输出cout
C++标准输出cout#include "stdafx.h" #include <iostream> using namespace std; #include <iomanip> //流的常用控制符的头文件 //输出 cout //cout cin是对象 int _tmain(int argc, _TCHAR* argv[]) { #if 0 //系统提供的相...
2018-03-03 14:38:23 368
转载 C++标准输入cin
C++标准输入cin#include "stdafx.h" #include <iostream> using namespace std; #include <string> //cin int _tmain(int argc, _TCHAR* argv[]) { int a; double b; string c; //cin >> a >...
2018-03-03 14:37:38 261
转载 C语言文件操作练习
C语言文件操作练习#include "stdafx.h" #include <iostream> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { FILE* fp = fopen("xx.c", "w+"); if (!fp) cout << "open error" <&am
2018-03-03 13:56:04 884
转载 fstream的自实现
fstream的自实现#include "stdafx.h" #include <iostream> using namespace std; #include <fstream> class Stream { public: Stream(char* path = NULL, char* mode = NULL) { //为实现open功能,创建对象时没有初值直...
2018-03-03 13:51:05 261
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人