vagabond20

vagabond20의 이미지

Personal

실명
+
직업
뷔이피 - 소프트웨어엔지니어링
관심사
루거미니포오틴마낭경장착
자기 소개


test1.cpp

#include
struct student {
int id;
char *name;
float percentage;
};
int main() {
struct student s={1, "Young G Choi", 90.5};
printf("Number: %d \n", s.id);
printf("Name: %s \n", s.name);
printf("Score: %f \n", s.percentage);
return 0;
}

test2.cpp
#include
using namespace std;
struct student {
int id;
char *name;
float percentage;
};
int main() {
student s={1, "Young G Choi", 90.5};
cout << "Number: " << s.id << endl;
cout << "Name: " << s.name << endl;
cout << "Score: " << s.percentage << endl;
return 0;
}

test3.cpp
#include
using namespace std;
struct student {
int id;
char *name;
float percentage;
void Show() {
cout << "Number: " << id << endl;
cout << "Name: " << name << endl;
cout << "Score: " << percentage << endl;
}
};
int main() {
student s={1, "Young G Choi", 90.5};
s.Show();
return 0;
}

test4.cpp
#include
using namespace std;
struct student {
int id;
char *name;
float percentage;
void Show();
};
void student::Show() {
cout << "Number: " << id << endl;
cout << "Name: " << name << endl;
cout << "Score: " << percentage << endl;
}
int main() {
student s1={1, "Young G Choi", 90.5};
s1.Show();
student s2={2, "Francis Y Choi", 78.2};
s2.Show();
return 0;
}

test5.cpp
#include

using namespace std;

struct student {
private:
int id;
char *name;
float percentage;
public:
void Show();
void SetInfo(int _id, char * _name, float _percentage);
};

void student::Show() {
cout << "Number: " << id << endl;
cout << "Name: " << name << endl;
cout << "Score: " << percentage << endl;
}

void student::SetInfo(int _id, char * _name, float _percentage)
{
id = _id;
name = _name;
percentage = _percentage;
}

int main() {
student s;

s.SetInfo(1, "Veronica Yang", 90.5);
s.Show();
return 0;
}

cpp_1_1.cpp
#include
int main()
{
std::cout << "Hello, world!" << std::endl;
return 0;
}

cpp_1_2.cpp
#include
int main()
{
std::cout << "Hello, world!" << std::endl;
std::string name = "Francis Choi";
std::cout << "Nigimi" << name << "Joto";
// printf("Nigimi %sJoto", name);
return 0;
}

cpp_1_3.cpp
#include
int main()
{
std::cout << "Hello, World!";
std::cout << "Hello, World!" << std::endl;
return 0;
}

cpp_1_4.cpp
#include
int main()
{
char name[10];
std::cin >> name;
std::cout << "Nigimi " << name << " Joto" << std::endl;
return 0;
}

cpp_1_5.cpp
#include
int main()
{
char name[10];
int age;
std::cin >> name >> age;
std::cout << "Name: " << name << " Age: " << age << " years old" << std::endl;
std::cout << "Enter your name: ";
std::cin >> name;
std::cout << "Enter your age: ";
std::cin >> age;
std::cout << "Name: " << name << " Age: " << age << " years old" << std::endl;
return 0;
}

기록

가입한지
9년 2 개월
Authentication providerIdentity
There are no connected identities.