大家帮我看一下这段代码哪里错了。
/*该程序计算某人在经过指定年数后的年份。*/#include<stdio.h>#defineTARGET_AGE88intyear1,year2;intcalcyear...
/*该程序计算某人在经过指定年数后的年份。*/
#include <stdio.h>
#define TARGET_AGE 88
int year1,year2;
int calcyear(int year1);
int main(void)
{
//询问用户的出生年份
printf("what year was the subject born?");
printf("Enter as a 4-digit year (YYYY):");
scanf(" %d", &yearl);
//计算指定年数后的年份,并显示该年份
year2 = calcyear(year1);
printf("someone born in %d will be %d in %d.",
year1,TARGET_AGE,year2);
return 0;
}
/*该函数计算将来年份*/
int calcYear(int year1)
{
return (year1 + TARGET_AGE);
} 展开
#include <stdio.h>
#define TARGET_AGE 88
int year1,year2;
int calcyear(int year1);
int main(void)
{
//询问用户的出生年份
printf("what year was the subject born?");
printf("Enter as a 4-digit year (YYYY):");
scanf(" %d", &yearl);
//计算指定年数后的年份,并显示该年份
year2 = calcyear(year1);
printf("someone born in %d will be %d in %d.",
year1,TARGET_AGE,year2);
return 0;
}
/*该函数计算将来年份*/
int calcYear(int year1)
{
return (year1 + TARGET_AGE);
} 展开
1个回答
展开全部
//主要是大小写和变量名称的问题
//该程序计算某人在经过指定年数后的年份。
#include <stdio.h>
#define TARGET_AGE 88
int year1,year2;
int calcYear(int year1);//注意这里的大小写 *
int main(void)
{
//询问用户的出生年份
printf("what year was the subject born?");
printf("Enter as a 4-digit year (YYYY):");
scanf(" %d", &year1);//注意这里的变量名*
//计算指定年数后的年份,并显示该年份
year2 = calcYear(year1);//注意这里的大小写 *
printf("someone born in %d will be %d in %d.",year1,TARGET_AGE,year2);
return 0;
}
/*该函数计算将来年份*/
int calcYear(int year1) //注意这里的大小写 *
{
return (year1 + TARGET_AGE);
}
AiPPT
2024-09-19 广告
2024-09-19 广告
随着AI技术的飞速发展,如今市面上涌现了许多实用易操作的AI生成工具1、简介:AiPPT: 这款AI工具智能理解用户输入的主题,提供“AI智能生成”和“导入本地大纲”的选项,生成的PPT内容丰富多样,可自由编辑和添加元素,图表类型包括柱状图...
点击进入详情页
本回答由AiPPT提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询