把年龄换算成天数的代码 并显示二者的值 求大神指点啊
#include<stdio.h>intmain(void){intyears,days;days=365*yearsprintf("pleaseinputyourold...
#include<stdio.h>
int main(void)
{
int years,days;
days=365*years
printf("please input your old:",years);
scanf("%d",&years);
printf("%d years are %d days",years,days);
return 0;
}
不考虑平年闰年 展开
int main(void)
{
int years,days;
days=365*years
printf("please input your old:",years);
scanf("%d",&years);
printf("%d years are %d days",years,days);
return 0;
}
不考虑平年闰年 展开
1个回答
推荐于2017-10-11
展开全部
#include<stdio.h>
int main(void)
{
int years,days;
printf("please input your old:",years);
scanf("%d",&years);
days=365*years; //移动到这里
printf("%d years are %d days",years,days);
return 0;
}
改成这样就好了,年龄还没输入呢,就开始计算了,当然不对了。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询