12 2024 档案
4.3文件输入,输出
摘要:文件的输入,输出根据打开方式的不同分为3种形式,分别是通过输入,输出重定向(freopen函数,需要引入的库文件为cstdio)的方式,输入,输出流(输入流ifstreamfin(),输出流ofstream fout(),需要引入的库文件为fstream)的方式和FILE指针(fopen函数,需要引
阅读全文
c++入门
摘要:⦁ C++基础 1. 数据类型 主要有五类数据类型:布尔类型,字符型,整型,浮点型和无类型。 部分数据类型及所占位数: 数据类型 C++语言表示 所占位数 范围 字符型 char 8b(1字节) -128~127或0~255 无符号字符型 unsigned char 8b(1字节) 0~255 整型
阅读全文
进制转换函数
摘要:#include <iostream> #include <bitsed> using namespace std; int main(){ cout<<oct<<10<<endl; //转换为二进制,则需要引入bitset库头文件 cout<<bitset<sizeof(int)>(a); ret
阅读全文
梦幻西游(文字版)
摘要:#include <iostream> using namespace std; int main(int argc, char** argv) { system("title 梦幻西游启动"); printf("你出生一个在数千年前,蚩尤复活动乱,挑起仙魔大战,\n"); printf("人类、仙
阅读全文
文件流(小山)
摘要:#include <iostream> #include <cstdio> using namespace std; struct no{ string name; int age; string blc; int shengao; int tizhong; }; int main(int argc
阅读全文