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\n个",i,x);
  10.  
  11. }
  12. return 0;
  13. }
  14.  
Success #stdin #stdout 0.01s 5308KB
stdin
Standard input is empty
stdout
第七天的桃子数为:1个
第6天的桃子数为:4
个第5天的桃子数为:10
个第4天的桃子数为:22
个第3天的桃子数为:46
个第2天的桃子数为:94
个第1天的桃子数为:190
个