标签:
/* Note:Your choice is C IDE */ #include "stdio.h" int main() { /*int i; for(i=1;i<=8;i++)*/ do { int road,money; printf("please input road:"); scanf("%d",&road); fflush(stdin); if(road<=2) { printf("money=8\n"); } else if(road>2) { money=5*(road-2)+8; printf("money=%d\n",money); } }while(1); getch(); }
ps:while();中填入循环条件,1为始真命题,即无限循环。
标签:
原文地址:http://www.cnblogs.com/lingzhipeng123/p/5969359.html