ClassTest/1.cpp

31 lines
779 B
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include <iostream>
#include <string>
using namespace std;
class GenshinImpact {
public:
string name;
int element;
void showPower() {
cout << "角色:" << name << endl;
cout << "元素力爆发!原神牛逼!" << endl;
cout << "风岩雷草水冰火,全图探索我做主!" << endl;
}
};
int main() {
GenshinImpact traveler;
traveler.name = "旅行者";
cout << "========================================" << endl;
cout << " 原神牛逼 " << endl;
cout << "========================================" << endl;
traveler.showPower();
cout << endl;
cout << "提瓦特大陆最强YYDS" << endl;
cout << "原神永远滴神!!!" << endl;
return 0;
}