#include<stdio.h> #include<stdlib.h> int main(){ int n,i; float s,l; while(1){ printf("请输入天数"); scanf("%d",&n); printf("请输入剩余桃子的个球"); scanf("%f",&l); for(i=1;i<=n;i++){ s=(l+1)*2; l=s; if(i<n) printf("第%d天剩余%f个桃子\n",n-i,s); } printf("\n猴子共摘了%f个桃子\n__________________________________________________________________________\n",s); } /*************下标线**************************/ return 0; }