《征程的开始!C++的冒险【1】!》

    “人类,醒醒!嘿,你还好吗?”

    一声呼唤将雨泽唤醒,他猛地睁开双眼,瞳孔突然紧缩,大口喘气着从地上坐起来。

    “嗨!我是QWQ_7,是你的导师,幸运的人类!”

     他警惕地上下扫视着眼前悬在半空的而且还会说话的铁球,没有答话。

     “欢迎来到这里!我会帮你回家的!” QWQ_7自顾自地说,“不过你得先其他人类一步寻找到线索!哦!我的天哪!太刺激了!我竟然被选来当导师了!哈哈哈哈哈!吼吼吼!哦买噶!全网都在看这个节目,我要冷静一点!不能破坏了我德高望重的形象!”

      雨泽一脸无语,看QWQ_7的时候,眼里多了份嫌弃。

       “咳咳,所以让我来为你介绍一下这个节目,哦不,挑战吧。” QWQ_7换了个低沉浑厚的声音,但激动还是让它浑身颤抖,“你将学习c++这门编程语言,利用它完成任务,闯过重重关卡,最终成功AKIOI的赢家会获得丰厚奖励!”

        “什么奖励?”他淡淡的随口问了句,但眸中的一闪而过的欣喜已经出卖了他的心情。

        “我们都将受万机膜拜~”

        “哦,没兴趣。”他的目光暗了下来。

        “别呀,不试试怎么知道有没有兴趣呢!”QWQ_7话罢,雨泽的双眼一阵刺痛,两三秒后,痛感减弱,视线也变得朦朦胧胧。再次清晰时,几串字符与单词在他的视网膜上微微晃动,一向英语不好的他,瞬间头脑发晕,不知所措,而QWQ_7则自顾自地让讲解文字也在他眼前滚动起来。


视网膜前的那串字符与单词:

#include<bits/stdc++.h>
using namespace std;
int main()
{
	return 0;
}

那些讲解文字:

一、#include<bits/stdc++.h>//万能头文件

C++的万能头文件是:

#include <bits/stdc++.h>

 

它是一个包含了每一个标准库的头文件。

优点:

  • 在算法竞赛中节约时间;
  • 减少了编写所有必要头文件的工作量。

缺点:

  • 不是GNU C++库的标准头文件,在部分情况下会编译失败;
  • 包含了很多不必要的东西,会大大增加编译时间。
源码:

⚠️ 这里去除了多余的注释,并删除了 cstdalign

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

// C

#ifndef _GLIBCXX_NO_ASSERT

#include <cassert>

#endif

#include <cctype>

#include <cerrno>

#include <cfloat>

#include <ciso646>

#include <climits>

#include <clocale>

#include <cmath>

#include <csetjmp>

#include <csignal>

#include <cstdarg>

#include <cstddef>

#include <cstdio>

#include <cstdlib>

#include <cstring>

#include <ctime>

#if __cplusplus >= 201103L

#include <ccomplex>

#include <cfenv>

#include <cinttypes>

#include <cstdbool>

#include <cstdint>

#include <ctgmath>

#include <cwchar>

#include <cwctype>

#endif

// C++

#include <algorithm>

#include <bitset>

#include <complex>

#include <deque>

#include <exception>

#include <fstream>

#include <functional>

#include <iomanip>

#include <ios>

#include <iosfwd>

#include <iostream>

#include <istream>

#include <iterator>

#include <limits>

#include <list>

#include <locale>

#include <map>

#include <memory>

#include <new>

#include <numeric>

#include <ostream>

#include <queue>

#include <set>

#include <sstream>

#include <stack>

#include <stdexcept>

#include <streambuf>

#include <string>

#include <typeinfo>

#include <utility>

#include <valarray>

#include <vector>

#if __cplusplus >= 201103L

#include <array>

#include <atomic>

#include <chrono>

#include <condition_variable>

#include <forward_list>

#include <future>

#include <initializer_list>

#include <mutex>

#include <random>

#include <ratio>

#include <regex>

#include <scoped_allocator>

#include <system_error>

#include <thread>

#include <tuple>

#include <typeindex>

#include <type_traits>

#include <unordered_map>

#include <unordered_set>

#endif

没搞懂没关系,反正把#include<bits/stdc++.h>这一句背下来就是了。

二、using namespace std; //命名空间

先把它拆开:

using - 使用

namespace - 名字空间

std - 标准

; 分号(在主函数里,每一句代码结束时都需要在末尾写上)

这就很好理解了,它的作用就是开辟名字空间。

using namespace std;也要背下来。

三、int main(){…}

int 我后面再讲,学过英语的话,你就会知道main的意思是 主要的 ,而括号  '()' 以及 '{'  '}'都是函数的写法,在以后的学习中你便会接触到。在这里,{ }中写的都是主函数的内容,在我们没有接触到函数的时候,我们的代码都要写在里面。

这前三句必须背下来,每一次写代码都要写下前三句!

这前三句必须背下来,每一次写代码都要写下前三句!

这前三句必须背下来,每一次写代码都要写下前三句!

(重要的事情说三次)

至于return 0; 我们下节课再说,看你这晕晕沉沉的样子讲了也吸收不了。快去休息会把,记得做作业哦!


作业:

1. 会用你的c++软件默写以下内容

#include<bits/stdc++.h>
using namespace std;
int main()
{
	return 0;
}

2.(选做)感兴趣的话可以查查return 0 的意思和作用。

好啦,快去休息会吧,消化消化今天的内容。


眼前的文字这才消失,困倦的雨泽倒头就睡,鼾声沉闷又持久……

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 7
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值