【每日刷题】 PAT 基础习题集 7-1 厘米换算英尺英寸

问题描述:
在这里插入图片描述
代码如下:

//7-1
#include <stdio.h>
int main ( void )
{
	int n;
	int foot, inch;
	scanf( "%d", &n );
	foot = (double)n / 100 / 0.3048;
	inch = ( (double)n / 100 / 0.3048 - foot ) * 12;
	printf( "%d %d", foot, inch );
	return 0;
} 

猜你喜欢

转载自blog.csdn.net/qq_40344308/article/details/88417265