为什么去掉year后结果不同
#include<stdio.h>
int main()
{
int year=2014;
int number=200;
do
{
number=number*1.2;
year++;}
while(number<1000);
printf("到%d年人数突破1000人\n",year);
return 0;
}
去掉\n后的year,结果会减一
#include<stdio.h>
int main()
{
int year=2014;
int number=200;
do
{
number=number*1.2;
year++;}
while(number<1000);
printf("到%d年人数突破1000人\n",year);
return 0;
}
去掉\n后的year,结果会减一
2016-11-23
举报