C++/프로그램 연습

Tower 실습하기

컴공 윤서혜 학습일기 2020. 9. 30. 16:03

using namespace std;

class Tower {
private:
	int height;

public:
	Tower();
	Tower(int tall);
	int getHeight();
};
#include <stdio.h>
#include <iostream>
#include <string>
#include <windows.h>
#include "circle.h"

using namespace std;

Tower::Tower() {
	height = 1;
}

Tower::Tower(int tall) {
	height = tall;
}

int Tower::getHeight() {
	return height;
}
#include <stdio.h>
#include <iostream>
#include <string.h>
#include "circle.h"

int main(void) {
	Tower myTower;
	Tower seoulTower(100);

	cout << "높이는 " << myTower.getHeight() << "미터" << endl;
	cout << "높이는 " << seoulTower.getHeight() << "미터" << endl;
	return 0;
}