More actions
소스
#include<iostream>
using namespace std;
float tofah(float );
int main()
{
float cel; //섭씨온도
float fah; //화씨온도
cout << "섭씨 온도를 입력하고 Enter 키를 누르십시오 : " ;
cin >> cel;
fah=tofah(cel);
cout << "섭씨 " << cel << "도는 화씨로 " << fah << "도 입니다." << endl;
return 0;
}
float tofah(float cel)
{
return (1.8 * cel) + 32.0;
}
음... 저 fah 라는 변수... 쓸데 없는건가?? 고민되네...ㅋㅋ -- (laciel)형노