-
-
Save tanakh/3ddcdd650585169b8860 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
using namespace std; | |
class Person { | |
string name; | |
int age; | |
char sex; | |
public: | |
Person(const string &nm, int n, char s) : name(nm), age(n), sex(s) {} | |
void show(); | |
}; | |
void Person::show() { | |
cout << "氏名: " << name << endl; | |
cout << "年齢: " << age << " 歳" << endl; | |
cout << "性別: " << sex << endl; | |
} | |
int main() | |
{ | |
Person yamada("ヤマダ", 26, 'M'); | |
Person tanaka("田中", 24, 'F'); | |
yamada.show(); | |
tanaka.show(); | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
using namespace std; | |
class Person { | |
string name; | |
int age; | |
char sex; | |
public: | |
Person(const string &nm, int n, char s) : name(nm), age(n), sex(s) {} | |
void show(); | |
}; | |
void Person::show() { | |
cout << "氏名: " << name << endl; | |
cout << "年齢: " << age << " 歳" << endl; | |
cout << "性別: " << sex << endl; | |
} | |
int main() | |
{ | |
Person tanaka("田中", 24, 'F'); | |
Person yamada("ヤマダ", 26, 'M'); | |
yamada.show(); | |
tanaka.show(); | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
using namespace std; | |
class Person { | |
string name; | |
int age; | |
char sex; | |
public: | |
Person(const string &nm, int n, char s) : name(nm), age(n), sex(s) {} | |
void show(); | |
}; | |
void Person::show() { | |
cout << "氏名: " << name << endl; | |
cout << "年齢: " << age << " 歳" << endl; | |
cout << "性別: " << sex << endl; | |
} | |
int main() | |
{ | |
Person chomado("ちょまど",24, 'F'); | |
Person yamada("ヤマダ", 26, 'M'); | |
Person tanaka("田中", 24, 'F'); | |
yamada.show(); | |
tanaka.show(); | |
Person chomado2("ちょまど",24, 'F'); | |
Person yamada2("ヤマダ", 26, 'M'); | |
Person tanaka2("田中", 24, 'F'); | |
Person chomado3; | |
Person yamada3; | |
Person tanaka3; | |
int a; | |
int b, c; | |
int d; | |
string t; | |
string u,v; | |
string w, | |
string ss("hoge"); | |
string tt("moge"); | |
string uu("hage"); | |
string vv; | |
string ww("hoge"); | |
string xx("hoge"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment