fork(1) download
  1. #include <stdio.h>
  2. int main(void) {
  3. int i,x;
  4. x=1;
  5. printf("第七天的桃子数为:1个\n");
  6. for(i=6;i>=1;i=i-1)
  7. {
  8. x=(x+1)*2;
  9. printf("第%d天的桃子数为:%d个",i,x);
  10. printf("\n");
  11.  
  12. }
  13. return 0;
  14. }
  15.  
Success #stdin #stdout 0.01s 5312KB
stdin
Standard input is empty
stdout
第七天的桃子数为:1个
第6天的桃子数为:4个
第5天的桃子数为:10个
第4天的桃子数为:22个
第3天的桃子数为:46个
第2天的桃子数为:94个
第1天的桃子数为:190个