2018年7月21日

C++编程基础一 21-for循环

摘要: 1 // 21-for循环.cpp: 定义控制台应用程序的入口点。 2 // 3 4 #include "stdafx.h" 5 #include 6 #include 7 #include 8 #include 9 using namespace std; 10 11 void FlipCharacter(); 12 int main() 13 { 14 ... 阅读全文

posted @ 2018-07-21 14:17 uimodel 阅读(176) 评论(0) 推荐(0) 编辑

C++编程基础一 17-指针和数组

摘要: 1 // 17-指针和数组.cpp: 定义控制台应用程序的入口点。 2 // 3 4 #include "stdafx.h" 5 #include 6 #include 7 8 using namespace std; 9 10 int main() 11 { 12 int a[]{345,65,23,7,2,856,23,83,176}; 13 c... 阅读全文

posted @ 2018-07-21 14:16 uimodel 阅读(121) 评论(0) 推荐(0) 编辑

C++编程基础一 15-枚举类型

摘要: 1 // 15-枚举类型.cpp: 定义控制台应用程序的入口点。 2 // 3 4 #include "stdafx.h" 5 #include 6 #include 7 using namespace std; 8 9 enum HeroType // 枚举类型是整型。适合用作标签Tag。 10 { 11 Tank, //0 12 Magic, ... 阅读全文

posted @ 2018-07-21 14:15 uimodel 阅读(125) 评论(0) 推荐(0) 编辑

C++编程基础一 16-指针

摘要: 1 // 16-指针.cpp: 定义控制台应用程序的入口点。 2 // 3 4 #include "stdafx.h" 5 #include 6 #include 7 8 using namespace std; 9 10 int main() 11 { 12 13 int a = 10; //定义变量后,系统默认会给变量分配一个地址。 14 flo... 阅读全文

posted @ 2018-07-21 14:15 uimodel 阅读(113) 评论(0) 推荐(0) 编辑

C++编程基础一 14-结构体

摘要: 1 // 14-结构体.cpp: 定义控制台应用程序的入口点。 2 // 3 4 #include "stdafx.h" 5 #include 6 #include 7 using namespace std; 8 9 //结构体比数组更加灵活,可以存储多种类型的多种数据。和数组一样都是复合类型。 10 11 struct Position //定义结构体 12 {... 阅读全文

posted @ 2018-07-21 14:14 uimodel 阅读(139) 评论(0) 推荐(0) 编辑

C++编程基础一 12-字符串

摘要: 1 // 12-字符串.cpp: 定义控制台应用程序的入口点。 2 // 3 4 #include "stdafx.h" 5 #include 6 #include 7 using namespace std; 8 9 int main() 10 { 11 //C语言的写法: 12 //错误的写法:没有'\0',在C语言中字符串是存在字符数组中的,'\... 阅读全文

posted @ 2018-07-21 14:13 uimodel 阅读(137) 评论(0) 推荐(0) 编辑

C++编程基础一 13-字符串基于string

摘要: 1 // 13-字符串基于string.cpp: 定义控制台应用程序的入口点。 2 // 3 4 #include "stdafx.h" 5 #include 6 #include 7 #include //引入string类库 8 using namespace std; 9 10 11 int main() 12 { 13 string str1; 1... 阅读全文

posted @ 2018-07-21 14:13 uimodel 阅读(184) 评论(0) 推荐(0) 编辑

C++编程基础一 11-数组

摘要: 1 // 11-数组.cpp: 定义控制台应用程序的入口点。 2 // 3 4 #include "stdafx.h" 5 #include 6 #include 7 using namespace std; 8 // 数组是复合类型,能够存储多个相同类型的数据。 9 int main() 10 { 11 12 char cArray[10]; 13 ... 阅读全文

posted @ 2018-07-21 14:11 uimodel 阅读(186) 评论(0) 推荐(0) 编辑

C++编程基础一 08-算数运算符

摘要: 1 // 08-算数运算符.cpp: 定义控制台应用程序的入口点。 2 // 3 4 #include "stdafx.h" 5 #include 6 #include 7 using namespace std; 8 9 int main() 10 { 11 //+ - * / % 加减乘除余(模) 12 int a; 13 cout > a... 阅读全文

posted @ 2018-07-21 14:08 uimodel 阅读(171) 评论(0) 推荐(0) 编辑

C++编程基础一 09-类型转换

摘要: 1 // 09-类型转换.cpp: 定义控制台应用程序的入口点。 2 // 3 4 #include "stdafx.h" 5 #include 6 #include 7 using namespace std; 8 9 10 void SwitchStature(); 11 void SwitchUnit(); 12 void Percent... 阅读全文

posted @ 2018-07-21 14:08 uimodel 阅读(131) 评论(0) 推荐(0) 编辑

导航