(C语言)如果已知英制长度的英尺foot和英寸inch的值,那么对应的米是(foot+inch/12)*0.3048。

2022-08-08 财经 714阅读

#include

intmain()

{

inta;

intfoot,inch;

scanf("%d",&a);

foot=(int)(0.01*a/0.3048);

inch=(int)(12*(0.01*a/0.3048-(double)foot));

printf("%d%d",foot,inch);

return0;

}

扩展资料

C数据类型长度操作

#include

void main(void)

{

char x = 'a';

char *p = "abcd";

char y[4] = {'a','b','c','d'};

int a = 10;

int *b = &a;

int c[4] = {1,2,3,4};

printf("%d,%d,%d\n",sizeof(x),sizeof(p),sizeof(y));

printf("%d,%d,%d\n",sizeof(a),sizeof(b),sizeof(c));

system("pause");

}

声明:你问我答网所有作品(图文、音视频)均由用户自行上传分享,仅供网友学习交流。若您的权利被侵害,请联系fangmu6661024@163.com