九妖科学
您身边的科学探索中心
           您身边的科学探索中心

度分秒计算器

更新时间:2023-01-19 点击: 41

#include

int main(void)
{
int degree, minute, second;
double total_second;

printf(“Enter a latitude in degrees, minutes, and seconds:\n”);
printf(“First, enter the degrees: “);
scanf(“%d”, &degree);
printf(“Next, enter the minutes of arc: “);
scanf(“%d”, &minute);
printf(“Finally, enter the seconds of arc: “);
scanf(“%d”, &second);

total_second = degree * 3600 + minute * 60 + second;

printf(“%d degrees, %d minutes, %d seconds = %.2f seconds\n”, degree, minute, second, total_second);

return 0;
}