목록Programming/명품 C++ Programming (4)
프로그래밍 공부

답지가 없는 문제들만 블로그에 올립니다 1번 문제 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 #include #include using namespace std; // 1번 문제 class Circle { int a; public: Circle() { this->a = 0; } Circle(int n) { this->a = n; } void print() { cout

정답을 공개 하지 않는 문제들만 블로그에 올렸습니다 2번 문제 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 #include #include #include #include using namespace std; // 2번 문제 int main() { int* arr = new int[5]; double solve = 0.0; cout arr[i]; solve += arr[i]; } cout

exp.h 파일 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 //exp_header #ifndef EXP_H #define EXP_H #include using namespace std; class Exp { public: int x, y; Exp(); Exp(int x); Exp(int x, int y); //~Exp(); int getValue(); int getBase(); int getExp(); bool equals(Exp b); }; #endif cs exp.cpp 파일 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 3..

C++를 시작한지 얼마안된 학생입니다. 객체지향이라는걸 완벽히 이해하지 못하여서 틀린것이나 오류가 있을수 있으니. 참고용으로만 사용해주시면 감사하겟습니다. #include #include using namespace std; class game { // 끝말잇기 게임 class 선언 string str; // 문자열을 입력받을 변수. string start = "아버지"; // 끝말잇기 시작 문자와 string class. int cnt = 0; // 이름을 출력하기 위한 변수. public: string input() { // 문자열 입력함수. string s; cin >> s; // s에 값을 대입. return s; // s를 반환. } bool compare(string s1, string s2)..