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