C++ 123

[C++]명품 C++ 프로그래밍 실습문제 10장 10번

[C++]명품 C++ 프로그래밍 실습문제 장 번 [C++]명품 C++ programming 실습문제 장 번 명품 C++ 프로그래밍실습문제/연습문제 /C++ #include #include #include #include #include using namespace std; class Nation { string nation; string capital; public: Nation(string n = 0, string c = 0) { //생성자를 생성해준다. nation = n; capital = c; } string getNation() { return nation; } string getCapital() { return capital; } bool nationCompare(string n) { //나라..

C++ 2023.01.25

[C++]명품 C++ 프로그래밍 실습문제 10장 8번

[C++]명품 C++ 프로그래밍 실습문제 10장 8번 [C++]명품 C++ programming 실습문제 10장 8번 명품 C++ 프로그래밍실습문제/연습문제 /C++ #include #include #include #include #include using namespace std; class Comparable{ public: virtual bool operator >(Comparable& op2)=0; //순수가상함수 virtual bool operator radious =radious;} int getRadious(){return radious;} bool operator >(Comparable &op){ Circle *p = (Circle *)&op; if(this->radious > p->get..

C++ 2023.01.25

[C++]명품 C++ 프로그래밍 실습문제 10장 6번

[C++]명품 C++ 프로그래밍 실습문제 10장 6번 [C++]명품 C++ programming 실습문제 10장 6번 명품 C++ 프로그래밍실습문제/연습문제 /C++ #include #include #include #include #include using namespace std; template T* remove(T src[], int sizeSrc, T minus[], int sizeMinus, int& retsize); int main() { int retsize=0; int src[4] = { 1,2,3,4 }; int minus[4] = { 1,2,3,0 }; int *q = remove(src, 4, minus, 4, retsize); //cout

C++ 2023.01.25

[C++] 명품 C++ 프로그래밍 실습문제 10장 오픈챌린지/openchallenge

[C++]명품 C++ 프로그래밍 실습문제 10장 [C++]명품 C++ programming 실습문제 10장 명품 C++ 프로그래밍실습문제/연습문제 /C++ #include #include #include #include #include using namespace std; class Word{ string Eng; string Kor; public: Word(string Eng, string kor){ this-> Eng = Eng; this-> Kor = kor; } string getEng(){return Eng;} string getKor(){return Kor;} }; int main() { string example[4] = { "" }; bool sw = false; srand((unsigne..

C++ 2023.01.25

[C++] 명품 C++ 프로그래밍 실습문제 9장 10번

[C++]명품 C++ 프로그래밍 실습문제 9장 10번 [C++]명품 C++ programming 실습문제 9장 10번 명품 C++ 프로그래밍실습문제/연습문제 /C++ //Circle.cpp #include "Circle.h" void Circle:: draw() { cout getNext(); } void GraphicEditor::deleteItem(int index) { Shape* pre = pStart; Shape* tmp = pStart; if (pStart == NULL) { cout getNext(); delete tmp; } else { pre->add(tmp->getNext()); delete tmp; } } void GraphicEditor::show() { Shape* tmp = pS..

C++ 2023.01.14

[C++] 명품 C++ 프로그래밍 실습문제 9장 9번

[C++]명품 C++ 프로그래밍 실습문제 9장 9번 [C++]명품 C++ programming 실습문제 9장 9번 명품 C++ 프로그래밍실습문제/연습문제 /C++ //Inkjet.cpp #include "Inkjet.h" int Inkjet::getavailabeInk(){return this->availabeInk;} void Inkjet:: print(int pages){ if(isValid(this->availablecount - pages)==true){ // 계산해주기 this-> printedcount = this->printedcount + pages; this-> availablecount = this->availablecount - pages; this-> availabeInk = thi..

C++ 2023.01.14