C언어
2013.03.19 10:18

ver3

조회 수 426 추천 수 0 댓글 1
?

단축키

Prev이전 문서

Next다음 문서

이전 다음 위로 아래로 댓글로 가기 인쇄 첨부 목록
?

단축키

Prev이전 문서

Next다음 문서

이전 다음 위로 아래로 댓글로 가기 인쇄 첨부 목록
Extra Form
  • profile
    너에게제공 2013.03.19 10:19 글쓴이
    #include<iostream>
    using namespace std;

    class Circle
    {
    private:
    int r;
    double area;
    public:
    Circle()
    {

    }

    void calcArea()
    {
    area=r*r*3.14;
    }
    void print()
    {
    cout<<"반지름 : "<<r;
    cout<<" 넓이 : "<<area<<endl;
    }
    void setRadius(int i)
    {
    r=i;
    }



    };

    int main()
    {
    Circle cr[3];
    for(int i=0; i<3; i++)
    {
    int a;
    cin>>a;

    cr[i].setRadius(a);
    cr[i].calcArea();
    }

    for(int j=0; j<3; j++)
    cr[j].print();
    }

  1. No Image

    Rectangle4

    Category :C언어
    Read More
  2. No Image

    Rectangle3

    Category :C언어
    Read More
  3. No Image

    Rectangle2

    Category :C언어
    Read More
  4. No Image

    Rectangle

    Category :C언어
    Read More
  5. No Image

    3-28

    Category :C언어
    Read More
  6. No Image

    ex1

    Category :C언어 Reply1
    Read More
  7. 예제4(Ver.2)

    Category :C언어 Reply1
    Read More
  8. 예제4 5명의 평균 구하기

    Category :C언어
    Read More
  9. 두 숫자 사이의 짝수 출력

    Category :C언어
    Read More
  10. 각 자리의수 합 구하기 예제

    Category :C언어 Reply1
    Read More
  11. ver3

    Category :C언어 Reply1
    Read More
  12. 원넓이 버전투

    Category :C언어
    Read More
  13. 원의 넓이

    Category :C언어
    Read More
  14. 특정 숫자 사이의 2,3의 배수 개수 구하기

    Category :C언어
    Read More
  15. 카운터 프로그램 VER.2

    Category :C언어
    Read More
Board Pagination Prev 1 2 3 4 5 Next
/ 5