365.2422 일 시간 분 초 계산
블레이
2023.04.01
#include stdio.h
int main(void)
{
float year = 365.2422 ;
int a, b, c ;
float d;
a = year ;
b = (year-a)*24 ;
c = ((year-a)*24-b)*60 ;
d = (((year-a)*24-b)*60-c) * 60 ;
printf(%d 일\n,a) ;
printf(%d 시간\n,b) ;
printf(%d 분\n,c) ;
printf(%4.2f 초\n,d) ;
return 0;
}
일 시간 분 까지는 맞게나오는다 초가 45초가 나오내요 ....
책에는 46.08초가 나와야된다는군요 .. 어디서 어떻게틀린지 가르쳐주세요 !