A股上市公司传智教育(股票代码 003032)旗下技术交流社区北京昌平校区

 找回密码
 加入黑马

QQ登录

只需一步,快速开始

  1. #import <Foundation/Foundation.h>
  2. void singTheSong(int numberOfBottles){
  3.     if(numberOfBottles==0){
  4.         printf("There are simply no more bottles of beer on the wall.\n");
  5.     }else{
  6.         printf("%d bottles of beer on the wall. %d bottles of beer.\n",numberOfBottles,numberOfBottles);
  7.         int oneFewer = numberOfBottles-1;
  8.         printf("Take one down,pass it around, %d bottles of beer on the wall.\n",oneFewer);
  9.         singTheSong(oneFewer);
  10.         printf("Put a bottle in the recycling, %d empty bottles in the bing.\n",numberOfBottles);
  11.     }
  12. }
  13. int main(int argc, const char * argv[]) {
  14.     @autoreleasepool {
  15.         singTheSong(99);
  16.     }
  17.     return 0;
  18. }
复制代码

0 个回复

您需要登录后才可以回帖 登录 | 加入黑马