问题遇到的现象和发生背景 这个为什么运行不了啊 大一新生
用代码块功能插入代码,请勿粘贴截图
#include<stdio.h>
int main()
{
int cm =0;
scanf("%d",&cm);
int foot = cm / 30.48;
int inch = ((cm/30.48)-foot)*12;
printf("身高为%d英尺,%d英寸\n",foot,inch);
return 0;
}
#include<stdio.h>
int main()
{
int cm =0;
scanf("%d",&cm);
int foot = cm / 30.48;
int inch = ((cm/30.48)-foot)*12;
printf("身高为%d英尺,%d英寸\n",foot,inch);
return 0;
}
VC环境下,变量定义都要放到代码块前面才行,代码块中间不能定义变量的
#include<stdio.h>
int main()
{
int cm =0,foot,inch;
scanf("%d",&cm);
foot = cm / 30.48;
inch = ((cm/30.48)-foot)*12;
printf("身高为%d英尺,%d英寸\n",foot,inch);
return 0;
}