#includefloatprice1,price2,price3;intcount_max;floatsort(floatincome1,floatincome2,floatincome3)main(){intcount1=0,count2=0,count3=0;intntotal;printf("youshoulddecidethemaxofthepeople'snumber,andthepriceofeveryplace。
\n");printf("so,first,plaseinputthemaxofpeople'snumber");scanf("%d",&count_max);printf("then,pleaseinputthepriceofeveryplace");scanf("%f,%f,%f",&price1,&price2,&price3);printf("1:summerpalace;\n");printf("2:winterpalace;\n");printf("3:horseracetrack;\n");printf("choosetheplaceyouwanttogoto:\n");printf("EnterEOFcharactertoendinput。
\n");while((ntotal=getchar())!=EOF){switch(ntotal){case1:++count1;break;case2:++count2;break;case3:++count3;break;case'\n':;case'':break; ("Incorrectnumberentered。
");printf("Enteranewnumber:\n");break;}printf("\nTotalsofpeoplenumbersforeachsightspots:\n");printf("summerpalace:%d\n",count1);printf("winterpalace:%d\n",count2);printf("horseracetrack:%d\n",count3);}return0;}。
全部