助けが必要。間違った出力。2013年から2017年までの値は同じ= 4400です。出力値が2013年から毎年異なるプログラムを統合する方法を教えてください。誰かが必要です。プログラムを修正できる少しのタッチで私を案内してくれます。 .
#include <stdio.h>
#include <conio.h>
#include <math.h>
main()
{
int Year;
int inipop, projpop;
int growth, sum;
printf("\n Please enter number of initial population: ");
scanf("%d",&inipop);
printf("\n Please enter the projected of population: ");
scanf("%d",&projpop);
printf("\nThe increase Year of Population: \n");
for(Year = 2013; Year <2018; Year++)
{
growth = inipop + projpop;
printf("%d %d\n",Year,growth*2);
}
getch();
return 0;
}
出力:
初期人口の数を入力してください: 2000
予測される人口を入力してください: 200
人口の増加年: 2013 4400 2014 4400 2015 4400 2016 4400 2017 4400