Unreal虚幻_C++学习

我使用到是 Clion 代码编辑器

下载地址:https://www.jetbrains.com/products.html#type=ide

 汉化教程:

Clion --> Preferences --> Plugins --> 搜索 Chinese --> install

 

C++入门练习代码示例:

//导入 iostream库
#include <iostream>

//入口函数
int main() {
//    导入 std 命名空间
    using namespace std;

    //单独导入 cout endl cin
//    using std::cout;
//    using std::endl;
//    using std::cin;

//    输出语句 cout 属于std 命名空间
    cout << "Hello World!!!";
    //输出 换行  \n换行
    cout << endl;
    cout << "我是你爸爸呀👨\n";

    //练习根据输入的年龄 来计算多少个月
    //创建一个int 变量 名字为 age
    int age;
    cin >> age; //输入 age年龄
    int month = age * 12; //计算月数 *表示乘号

    cout << "在地球上生存了"<<month<<"个月\n";

    //此 输入是为了防止 执行到return 是程序结束
    cin >> age;
        //返回一个 整形
    return 0;
}

变量命名规则

 

整型(基本类型)

字符类型

代码示例:

//
//  main.cpp
//  004-整型
//
//  Created by linjie on 2020/12/29.
//

#include <iostream>
using namespace std;

int main(int argc, const char * argv[]) {
    // insert code here...
    short s = 3.1;
    int i = 1;
    long l = 111;
    
    //加了unsigned 整型类型 不能赋值负值 且 正值的存储量扩大两倍
    unsigned short e = -3;
    int b = 10000000000000000;
    unsigned int f = 40000000000000000;
    
    cout << "----------数值类型--------" << endl;
    cout << "型" << s << endl;
    cout << "整型" << i << endl;
    cout << "长整型" << l << endl;
    
    cout << "----------最大最小值--------" << endl;
    cout << INT_MAX << endl; //int 存储最大值
    cout << INT_MIN << endl; //int 存储最小值
    cout << SHRT_MAX << endl; //Short 存储的最大值
    cout << SHRT_MIN << endl;//Short 存储的最小值
    
    cout << "----------unsigned--------" << endl;
    cout << e << endl;
    cout << b << endl;
    cout << f << endl;
    
    
    //字符类型
    //ASC 码表 http://ascii.911cha.com/
    char aa = ' '; //空格符号 也属于一个字符
    char bb = 'a';
    char cc = 97; // 97 对应 ASC码表的 字符 a
    char dd = '\\n';
    int ee = 'a'; //字符可以 给int类型 赋值
    
    cout << "----------char字符也属于整型--------" << endl;
    cout << "aa =>" << aa << endl;
    cout << "bb =>" << bb << endl;
    cout << "cc =>" << cc << endl;
    cout << "dd =>" << dd << endl;
    cout << "ee =>" << ee << endl;
    
    cin.get();
    
    return 0;
}

输出结果:

 

Bool布尔类型

//
//  main.cpp
//  bool类型
//
//  Created by linjie on 2021/1/6.
//

#include <iostream>

using namespace::std;

int main(int argc, const char * argv[]) {
    
    //bool布尔类型
    bool a = true; //1
    bool b = false; //0
    
    //为bool 类型 赋值 非0即1 1表示true
    bool c = 100;
    bool d = 2;
    
    cout << "---------bool类型---------" << endl;
    cout << "a =>" << a << endl;
    cout << "b =>" << b << endl;
    cout << "c =>" << c << endl;
    cout << "d =>" << d << endl;
    
    cin.get();
    
    return 0;
}

输出结果:

 

const常量

代码示例:

//
//  main.cpp
//  const-常量
//
//  Created by linjie on 2021/1/7.
//

#include <iostream>
using namespace::std;

int main(int argc, const char * argv[]) {
    
    //变量是可变的
    int a = 100;
    a = 90;
    
    //常量 不可变的量
    const int b = 11;
    //b = 10; //该行报错 常量不可变 只能赋值一次
    
    return 0;
}

 

浮点类型

代码示例:

//
//  main.cpp
//  浮点类型
//
//  Created by linjie on 2021/1/7.
//

#include <iostream>
#include <climits> //引入函数库 才能输出__FLT_MAX__ 和 __FLT_MIN__
using namespace::std;

int main(int argc, const char * argv[]) {
    
    //单精度 浮点
    float a = 1.1;
    //双精度浮点
    double b = 2.222;
    //长双精度浮点
    long double c = 2.2222;
    
    cout<< "浮点存储最大值" << __FLT_MAX__ << endl;
    cout<< "浮点存储最小值" << __FLT_MIN__ << endl;
    
}

输出结果:

 

简单练习:

//
//  main.cpp
//  浮点类型
//
//  Created by linjie on 2021/1/7.
//

#include <iostream>
#include <climits> //引入函数库 才能输出__FLT_MAX__ 和 __FLT_MIN__
using namespace::std;

int main(int argc, const char * argv[]) {
    
    //1.让用户输入自己的身高(米),然后把它转换成厘米输出出来。
    float height;
    cout << "请输入您的身高(米)=>";
    cin >> height;
    cout << endl << "您身高为 =>" << height * 100 << "厘米。" << endl;

    //2.编写一个程序,让用户输入秒,然后把它转换成 多少天 多少小时 分钟 秒
    float min;
    cout << "请输入多少秒(自动转换)" ;
    cin >> min;
    cout << min / 60 / 24 << "天" << min / 60 << "小时" << min << "分钟" << min * 60 << "秒" << endl;

    //3.要求用户输入一个班级的 男生和女生的数量,并输出女生的比例(百分比)
    float Ncount;
    cout << "请输入男生的数量 ==>";
    cin >> Ncount;

    float Wcount;
    cout << "请输入女生的数量 ==>";
    cin >> Wcount;

    cout << "女生比例为 ==>  " << Wcount/(Ncount + Wcount) * 100 << "%" << endl;

    //输入一个 四位数 获取 个 十 百 千分位的数值
    int shu;
    cout << "请输入一个四位数 ==> ";
    cin >> shu;
    
    int ge = shu % 10;
    int shi = (shu % 100) /10;
    int bai = (shu % 1000) /100;
    int qian = shu / 1000;
    
    cout << "个位=>" << ge << "   十位=>" << shi << "   百位=>" << bai << "   千位=>" << qian;
    
    
}

输出结果:

 

数组

//
//  main.cpp
//  数组
//
//  Created by linjie on 2021/1/7.
//

#include <iostream>
#include <climits> //引入函数库 才能输出__FLT_MAX__ 和 __FLT_MIN__
using namespace::std;

int main(int argc, const char * argv[]) {
    
    //语法: 变量类型 数组名字[长度] = {数组的值};
    //第一种数组 赋值方式
    int arr[4] = {1,2,3,4};
    //第二种赋值方式 赋值的 个数等于或小于声明的数组长度
    int arr2[4] = {1,2,3};
    //第三种赋值方式 不声明数组长度 自动根据你 赋值的个数自动确定数组长度
    int arr3[] = {1,2,3,4,5,6,7,8};
    
    //C++ 11 数组语法
    int arr4[]{4,5,6,1};
    
    cout << arr4[-1] << endl; //访问一个不存在的下标的值 输出1
    cout << arr4[5] << endl; //访问一个不存在的下标的值 输出2
    cout << arr4[0] << endl; //访问一个 存在的下标的值 输出4
    arr4 [0] = 100; //修改数组下标为0 的值
    cout << arr4[0] << endl; //输出 100
}

输出结果:

 

字符串

//
//  main.cpp
//  string字符串
//
//  Created by linjie on 2021/1/7.
//

#include <iostream>
#include <climits> //引入函数库 才能输出__FLT_MAX__ 和 __FLT_MIN__
using namespace::std;

int main(int argc, const char * argv[]) {
    
    //语法:  string 字符串名字 = "值";
    string str = "阿威";
    
    //字符串拼接
    string str1 = "黑狗";
    string str2 = "牛逼";
    string str3 = str1 + str2;
    cout << str3 << endl; //黑狗牛逼
    //字符串的长度大小 size()
    cout << str3.size() << endl;
    
    //输入getline不建议和cin进行混用
    cout << "请输入任意信息=>";
    getline(cin, str3);
    cout << str3 << endl;
    
    //字符串赋值
    string str4 ;
    string str5 = "队长啊星";
    str4 = str5;
    cout << str4 << endl; //队长啊星
    cout << str5 << endl; //队长啊星
    
}

输出结果:

 

结构体

//
//  main.cpp
//  struct结构体
//
//  Created by linjie on 2021/1/7.
//

#include <iostream>
#include <climits> //引入函数库 才能输出__FLT_MAX__ 和 __FLT_MIN__
using namespace::std;

//定义结构体 在外部定义 每个函数都能访问
struct Test{
    string type1;
    string type2;
    string type3;
};

int main(int argc, const char * argv[]) {
    
    //结构体 申明赋值
    Test t1{"怪物","英雄","物品"};
    //调用方法  结构体赋值申明的名字.结构体内定义的变量名  比如:t1.type1
    cout << t1.type1 << "   " << t1.type2 << "   " << t1.type3 << endl;
    
    //结构体数组
    Test test[]{{"怪物","英雄","物品"},{"怪物2","英雄2","物品2"},{"怪物3","英雄3","物品3"}};
    //访问 结构体数组内的值
    cout << test[1].type1 << "   " << test[1].type2 << "   " << test[1].type3 << endl;
}

输出结果:

 

枚举类型

//
//  main.cpp
//  enum枚举类型
//
//  Created by linjie on 2021/1/7.
//

#include <iostream>
#include <climits> //引入函数库 才能输出__FLT_MAX__ 和 __FLT_MIN__
using namespace::std;

//定义枚举 在外部定义 每个函数都能访问
enum HeroType{
  ShuChu,  //0
  FaShi,   //1
  ShangDan, //2
  DaYe,     //3
  FuZhu     //4
};

int main(int argc, const char * argv[]) {
    //调用枚举类型
    //枚举类型 枚举变量名字 = 枚举内定义的值的名字;
    HeroType heroType = ShuChu;
    cout << heroType << endl; //0
    heroType = FaShi;
    cout << heroType << endl; //1
    int aa = FaShi + 2;
    cout << aa << endl; //3
    heroType = HeroType(4);
    cout << heroType << endl; //4
    cout << ShangDan << endl; //2
}

输出结果:

 

指针

//
//  main.cpp
//  指针
//
//  Created by linjie on 2021/1/7.
//

#include <iostream>
#include <climits> //引入函数库 才能输出__FLT_MAX__ 和 __FLT_MIN__
using namespace::std;

int main(int argc, const char * argv[]) {
    int a = 1;
    int b = 2.5;
    
    //& 取一个变量的内存地址
    //* 取一个内存地址 存储的值
    cout << "获取a变量内存地址=> " << &a <<endl;
    cout << "获取a变量的值==> " << *(&a) << endl;
    cout << "获取b变量内存地址=> " << &b <<endl;
    cout << "获取b变量的值==> " << *(&b) << endl;
    
    //指针定义
    //语法: 变量类型* 变量名 = &值;
    int* aa = &a;
    int* bb = &b;
    //输出地址
    cout << aa << endl;
    cout << bb << endl;
    //输出值
    cout << *aa << endl;
    cout << *bb << endl;
    
    int* cc = &a;
    int* dd = &a;
    //因为 cc dd 都指向同一个地址 那就变量a的地址 所以改变 a cc dd任意一个变量的值 三个值都会跟着改变
    *cc = 100;
    cout << a << "   " << *cc << "   " << *dd << endl;  // 100 100 100
    *dd = 200;
    cout << a << "   " << *cc << "   " << *dd << endl; // 200 200 200
    a = 11;
    cout << a << "   " << *cc << "   " << *dd << endl;// 11 11 11
    
    //空指针的申明 三种方式
    int* ee = 0;
    int* ff = NULL;
    int* gg = nullptr; //C++11 的语法 nullptr专门为指针而生 空指针
    
    //void 声明一个 可以接收任何类型的指针
    void * hh;
    hh = &a;
    //hh = &b;
    cout << *((int*)hh) << endl;  // (int*)强制转换为int类型的指针数据
    

    //new int 申请声明一个 新的内存
    int * ii = new int;
    *ii = 100;
    cout << *ii << endl;
    delete ii;  //delete 删除指针
    
    
}

输出结果:

 

指针和数组的关系

//
//  main.cpp
//  指针和数组的关系
//
//  Created by linjie on 2021/1/7.
//

#include <iostream>
#include <climits> //引入函数库 才能输出__FLT_MAX__ 和 __FLT_MIN__
using namespace::std;

int main(int argc, const char * argv[]) {
    
    //其实数组本身 就是一个指针
    int arr[]{1,2,3,4,5,6,7,8,9,10};
    cout << arr << endl; //数组本身就是一个指针 输出数组 就是输出其内存地址
    cout << *arr << endl; //*号 取一个内存地址里的值 输出1 数组默认是指针
    cout << *arr + 1 << endl; //*arr默认取第一个值 *arr+1表示取第二个值 依次类推 *arr+2就是取第三个值
    
    //使用new 创建数组 new 表示开辟一个新的内存地址 所以不用了 要用delete删除
    int * pp = new int[20];
    //取值 赋值方式一
    pp[0] = 88;
    cout << pp[0] << endl;
    //取值 赋值方式二 (指针方式)
    *(pp + 1) = 99;
    cout << *(pp + 1) << endl;
    
    //删除 不用的 开辟的内存地址
    delete[] pp;
}

输出结果:

 

C++11 数组创建方式(推荐)

//
//  main.cpp
//  C++11 数组创建方式
//
//  Created by linjie on 2021/1/7.
//

#include <iostream>
#include <climits> //引入函数库 才能输出__FLT_MAX__ 和 __FLT_MIN__
#include <array> //使用 C++11 数组创建方式 需要引入该类库
using namespace::std;

int main(int argc, const char * argv[]) {
    
    //C++11 数组创建方式
    array<int,6> arr1 = {1,2,3,4,5,6};
    array<int, 6> arr2;
    arr2 = arr1; //可以直接 数组 = 数组
    cout << arr1[0] << "  " << arr2[0] << endl;
    cout << arr2[5] << "  " << arr2[5] << endl;
    cout << arr1[6] << "  " << arr2[6] << endl; //数组这里声明最大长度为6 但是这里访问第七个值 也就是下标6 输出1 访问下标7 输出2 依次类推
}

输出结果:

 

for循环

//
//  main.cpp
//  for 循环
//
//  Created by linjie on 2021/1/7.
//

#include <iostream>
#include <array> //使用 C++11 数组创建方式 需要引入该类库
using namespace::std;

int main(int argc, const char * argv[]) {
    
    
    array<int, 10> arr = {1,2,3,4,5,6,7,8,9,10};
    //for循环
    //语法:
//    for (初始化变量; 循环条件判断; 变量自增长) {
//        方法体
//    }
    //循环输出数组里的值
    for (int i = 0; i < arr.size(); i++) {
        cout << arr[i] << endl;
    }
    
}

输出结果:

 

组合赋值运算符 和 关系运算符

//
//  main.cpp
//  组合赋值运算符 和 关系运算符
//
//  Created by linjie on 2021/1/7.
//

#include <iostream>
#include <array> //使用 C++11 数组创建方式 需要引入该类库
#include <string>
using namespace::std;

int main(int argc, const char * argv[]) {
    
    //  组合赋值运算符
    // + - * / % (加 减 乘 除 取余)
    // += -= *= /= %= (加等 减等 乘等 除等 取余等)
    int a = 11;
    int b = 22;
    a += b; // a = a + b;  33
    cout << a << endl;
    a -= b; // a = a - b;  11
    cout << a << endl;
    a *= b; // a = a * b;  242
    cout << a << endl;
    a /= b; // a = a / b;  11
    cout << a << endl;
    a %= b; // a = a % b;  11
    cout << a << endl;
    
    //逻辑运算符
    // > >= < <= == != (大于 大于或等于 小于 小于或等于 等于 不等于)
    int c = 11;
    int d = 22;
    int e = 11;
    cout << (c > d) << endl; //输出0 0表示false 错误 满足就返回true 不满足返回false
    cout << (c < d) << endl; //输出1 1表示true 正确 满足就返回true 不满足返回false
    cout << (c >= e) << endl; //输出1 1表示true 正确 >= 大于或等于只要成立一个 满足就返回true 不满足返回false
    cout << (c <= e) << endl;//输出1 1表示true 正确 <= 小于或等于只要成立一个 满足就返回true 不满足返回false
    cout << (c == e) << endl;//输出1 1表示true 正确 == 等于满足 满足就返回true 不满足返回false
    cout << (c != e) << endl; //输出0 0表示fasle 错误 != 不等于 不满足返回false 满足返回true
    
    //字符串比较
    char ch[] = "牛逼";
    char ch2[] = "牛逼";
    cout << (ch == ch2) << endl; //返回0 不相等 因为两个数组 比较的是内存地址 内存地址不相同所以返回0
    cout << strcmp(ch, ch2) << endl; //这个比较特殊 返回0 这里的0表示相等 1表示不想等  strcmp()比较两个char字符类型的数据是否相等
    
    string str = "队长阿威";
    string str2 = "队长阿威";
    cout << (str == str2) << endl; //返回1 表示相等
    
    
    
    
    
}

输出结果:

 

while循环

//
//  main.cpp
//  while 循环
//
//  Created by linjie on 2021/1/7.
//

#include <iostream>
#include <array> //使用 C++11 数组创建方式 需要引入该类库
#include <string>
using namespace::std;

int main(int argc, const char * argv[]) {
    
 //for循环与while循环比较
//    for (初始化; 条件判断; 自增) {
//        方法体
//    }
 
//语法:
//    初始化
//    while(条件判断){
//        方法体
//        自增
//    }
    
    int i = 0;
    while(i < 10){
        cout << "循环执行了" << i+1 << "次" << endl;
        i++;
    }
}

输出结果:

 

宏和类型别名

//
//  main.cpp
//  宏-类型别名
//
//  Created by linjie on 2021/1/7.
//

#include <iostream>
#include <array> //使用 C++11 数组创建方式 需要引入该类库
#include <string>
using namespace::std;

//宏定义
//#define 别名 代码段
#define Start int main

//类型别名
//typedef 数据类型 别名;
typedef string XingString;

//宏调用
Start(int argc, const char * argv[]) {
    XingString str = "类型别名";
    cout << str << endl;
}

输出结果:

 

do while循环和for循环第二种方式

//
//  main.cpp
//  do wile循环和for循环第二种方式
//
//  Created by linjie on 2021/1/7.
//

#include <iostream>
#include <array> //使用 C++11 数组创建方式 需要引入该类库
#include <string>
using namespace::std;

int main(int argc, const char * argv[]) {
//     初始化
//    do {
//        循环体
//        自增
//    } while (循环条件);
    
    int i = 0;
    do {
        cout << "第" << i+1 << "次循环" << endl;
        i++;
    } while (i < 10);
    
    //for循环第二种方式输出 数组
//    for(数据类型 别名 : 数组名称){
//        方法体
//    }
    array<int, 5> arr = {1,2,3,4,5};
    for(int temp : arr){
        cout << temp << endl;
    }
    
}

输出结果:

 

二维数组和循环嵌套

//
//  main.cpp
//  二维数组和循环嵌套
//
//  Created by linjie on 2021/1/7.
//

#include <iostream>
#include <array> //使用 C++11 数组创建方式 需要引入该类库
using namespace::std;

int main(int argc, const char * argv[]) {
    
    //int arr[行][列] = { {},{},{},{},{} };
    //创建一个 5行5列的二维数组
    int arr[5][5] ={
        {1,2,3,4,5},
        {1,2,3,4,5},
        {1,2,3,4,5},
        {1,2,3,4,5},
        {1,2,3,4,5}
    };
    
    //循环嵌套
    for (int i =0; i < 5; i++) { //外层循环执行 一次
        for (int j =0; j < 5; j++) { //内层循环 执行完 次
            cout << i << " " << j << endl;
        }
    }
//    0 0
//    0 1
//    0 2
//    0 3
//    0 4
//    1 0
//    1 1
//    1 2
//    1 3
//    1 4
//    2 0
//    2 1
//    2 2
//    2 3
//    2 4
//    3 0
//    3 1
//    3 2
//    3 3
//    3 4
//    4 0
//    4 1
//    4 2
//    4 3
//    4 4
    
    //先输出 行 在输出 列
    for (int i =0; i < 5 ; i++) { //外层循环执行 一次
        for (int j =0; j < 5; j++) { //内层循环 执行完 次
            cout << arr[i][j] << " ";
        }
        cout << endl;
    }
//    1 2 3 4 5
//    1 2 3 4 5
//    1 2 3 4 5
//    1 2 3 4 5
//    1 2 3 4 5
    
    //先输出 列 在输出 行
    for (int i =0; i < 5 ; i++) { //外层循环执行 一次
        for (int j =0; j < 5; j++) { //内层循环 执行完 次
            cout << arr[j][i] << " ";
        }
        cout << endl;
    }
//    1 1 1 1 1
//    2 2 2 2 2
//    3 3 3 3 3
//    4 4 4 4 4
//    5 5 5 5 5
    
}

 

if else判断语句

//
//  main.cpp
//  if else判断语句
//
//  Created by linjie on 2021/1/7.
//

#include <iostream>
#include <array> //使用 C++11 数组创建方式 需要引入该类库
using namespace::std;

int main(int argc, const char * argv[]) {

    
    int hp = 0;
    //语法
//    if(判断条件){
//        条件成立 执行这里的代码
//    }else{
//        否则不成立 执行这里的代码
//    }
    if(hp == 0){
        cout << "英雄已经阵亡" << endl;
    }else{
        cout << "英雄生命值很健康" << endl;
    }
    
    
    int age = 17;
//    if(判断条件){
//        条件成立 执行这里的代码 然后跳出判断
//    }else if(判断条件){
//        成立 执行这里的代码 然后跳出判断
//    }else{
//        否则以上条件都不满足 执行这里的代码 然后跳出判断
//    }
    if(age < 18){
        cout << "您未满18岁" << endl;
    }else if(age >= 18){
        cout << "您已成年可以尽情游玩" << endl;
    }else{
        cout << "否则执行我" << endl;
    }
    
    //if判断语句第二种写法 不需要方法体 默认紧挨到一行 为方法体代码
    if(age == 17)
        cout << "您今年17岁了" << endl;
    
}

输出结果:

 

逻辑运算符

//
//  main.cpp
//  逻辑运算符
//
//  Created by linjie on 2021/1/7.
//

#include <iostream>
#include <array> //使用 C++11 数组创建方式 需要引入该类库
using namespace::std;

int main(int argc, const char * argv[]) {

    int a = 1;
    int b = 11;
    
    //逻辑运算符 &&(与) ||(或) !(非)
    
//&&(与) 必须两边条件 都满足才为true 否则其中一边不满足 则为false
    bool result = a > 0 && a==1;
    bool result2 = a > 0 && b==1;
    cout << result << endl; //1 true
    cout << result2 << endl; //0 false
    
//||(或) 两个条件 其中一边满足就为true 除非两个条件不满足 才为false
    bool result3 = a > 0 || a==1;
    bool result4 = a > 0 || b==1;
    cout << result3 << endl; //1 true
    cout << result4 << endl; //1 true
    
//!取反
    cout << !true << endl; //0 false
    cout << !false << endl; //1 true
}

输出结果:

 

三元表达式

//
//  main.cpp
//  逻辑运算符
//
//  Created by linjie on 2021/1/7.
//

#include <iostream>
#include <array> //使用 C++11 数组创建方式 需要引入该类库
using namespace::std;

int main(int argc, const char * argv[]) {

  //三元表达式
  //语法:  判断条件?成立取这里的值:不成立取这里的值
    int a = true ? 100 : 1;
    cout << a << endl; //100
    
    //相当于 =>
    if(true){
        a = 100;
    }else{
        a = 1;
    }
    cout << a << endl; //100
    
    
    
}

输出结果:

 

switch判断

//
//  main.cpp
//  switch判断
//
//  Created by linjie on 2021/1/7.
//

#include <iostream>
#include <array> //使用 C++11 数组创建方式 需要引入该类库
using namespace::std;

int main(int argc, const char * argv[]) {

//语法:
//    switch (判断的变量) {
//        case 判断条件:
//                该条件成立 执行这里的代码
//            break; //执行完后跳出switch
//        case 判断条件:
//                该条件成立 执行这里的代码
//            break;//执行完后跳出switch
//        case 判断条件:
//                该条件成立 执行这里的代码
//            break;//执行完后跳出switch
//        default:
//                上面全部条件不成立 执行这里
//            break;//执行完后跳出switch
//    }
    
    int money = 100;
    switch (money) {
        case 100:
            cout << "恭喜你成为至尊VIP1" << endl;
            break;
        case 1000:
            cout << "恭喜你成为至尊VIP2" << endl;
            break;
        case 10000:
            cout << "恭喜你成为至尊VIPMAX" << endl;
            break;
        default:
            cout << "恭喜你一分没冲" << endl;
            break;
    }
}

输出结果:

 

 

 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值