내가푼답
main cpp
#include <iostream>
using namespace std;
const double PI = 3.141592;
#include "area.h"
#include "circumference.h"
int main( )
{
int r;
double result1, result2;
while (true)
{
cout <<endl<< ">> 반지름을 입력하세요 (종료=0) ?";
cin >> r;
if (r == 0)
break;
result1=area(r);
result2 = circumference(r);
cout <<"반지름 " << r << "cm인 원의 면적은" << result1 <<" 입니다" <<endl;
cout << "반지름 " << r << "cm인 원의 둘레은" << result2 << " 입니다" << endl<<endl;
}
}
cppcircumference.h
double circumference(int r)
{
double circumference = 2 * PI * r;
return circumference;
}
area.h
double area(int r)
{
double area = r * r * PI;
return area;
}