首页 > 代码库 > 9.16作业 甘燚

9.16作业 甘燚

1 NSLog(@"char-%zu",sizeof(char)); 2 3 NSLog(@"int-%zu\n,float-%zu\n,double-%zu\n",sizeof(int),sizeof(float),sizeof(double)); 4 5 NSLog(@"long-%zu\n,longlong-%zu\n,short-%zu\n",sizeof(long),sizeof(long long),sizeof(short)); 6 7 8 9 NSLog(@"%.4f\n",2.3f);10 11 12 13 int num=9;//初试长度14 15 int i=num;16 17 int a;18 19 int lose;//前缀空格长度20 21 for(i;i>=0;i--){22 23 if(i%2==0){24 25 a=i;26 27 lose = (num-i)/2;28 29 for(lose;lose>=0;lose--){30 31 printf(" ");32 33 }34 35 for(a; a >= 0; a--){36 37 printf("*");38 39 }40 41 printf("\n");42 43 }44 45 }

 

9.16作业 甘燚