牛客编程初学者入门训练150题
链接: 牛客编程初学者入门训练150题
希望大家学习和纠错。
BC1 实践出真知
链接: 实践出真知
【说明】
(1)printf的使用
#include <stdio.h>
int main(void)
{
printf("Practice makes perfect!\n");
return 0;
}
BC2 我是大V
链接: 我是大V
【说明】
(1)\n的使用
#include <stdio.h>
int main() {
printf("v v\n v v\n v\n");
return 0;
}
BC3 有容乃大
链接: 有容乃大
【说明】
(1)打印sizeof()类型的值,使用%zd转换说明
#include<stdio.h>
int main()
{
printf("The size of short is %zd bytes.\n",sizeof(short));
printf("The size of int is %zd bytes.\n",sizeof(int));
printf("The size of long is %zd bytes.\n",sizeof(long));
printf("The size of long long is %zd bytes.\n",sizeof(long long));
return 0;
}
BC6 小飞机
链接: 小飞机
【说明】
(1)注意对齐
#include <stdio.h>
int main()
{
printf(" **\n");
printf(" **\n");
printf("************\n");
printf("************\n");
printf(" * *\n");
printf(" * *\n");
return 0;
}
BC7 缩短二进制
链接:
转载自CSDN-专业IT技术社区
版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。