| #include<iostream> using namespace std; class Rectangle { private: int width, height, area; public: Rectangle(int w=5, int h=10) {width=w; height=h;} void setRectangle(int w, int h) {width=w; height=h;} void calcArea(){area=width*height;} int getArea(){return area;} void print(); }; void Rectangle::print() { cout<<"가로 : "<< width << ",세로 : " << height << ",넓이" << area <<endl; } void main() { Rectangle r; r.calcArea(); r.print(); } |
| 번호 | 분류 | 제목 |
|---|---|---|
| 103 | C언어 | Rectangle4 |
| 102 | C언어 | Rectangle3 |
| 101 | C언어 | Rectangle2 |
| » | C언어 | Rectangle |
| 99 | C언어 |
3-28
|
| 98 | C언어 |
ex1
|
| 97 | C언어 |
예제4(Ver.2)
|
| 96 | C언어 |
예제4 5명의 평균 구하기
|
| 95 | C언어 |
두 숫자 사이의 짝수 출력
|
| 94 | C언어 |
각 자리의수 합 구하기 예제
|
| 93 | C언어 |
ver3
|
| 92 | C언어 |
원넓이 버전투
|
| 91 | C언어 |
원의 넓이
|
| 90 | C언어 |
특정 숫자 사이의 2,3의 배수 개수 구하기
|
| 89 | C언어 |
카운터 프로그램 VER.2
|