我正试图制定一项方案,查明他们有多少月活着,但还是有一些问题。 我迄今的职能是:
int getResult(int year, month, day, endResult)
{
int thisYear, thisMonth, thisDay;
year = thisYear - year;
year *= 12;
}
我想要完成的工作将显示这样的产出:
Output:
What year were you born?
1989
What month were you born?
5
What day were you born?
23
You are x months old.
我将持续几个月,但后来我认识到,如果他们出生的月份是在本月或之前的? 因此,如果任何人在计算方法上有任何倾向,我将不胜感激。