描述
于老师经常告诉我们“学习编程最好的办法就是上机实践,因为你要对计算机下指令,想让计算机帮你干活,就得多和计算机‘交流’,实践才能出真知。”
输入描述:
无
输出描述:
Practice makes perfect!
#include<stdio.h>intmain(){printf("Practice makes perfect!");return0;}
BC02-我是大V
描述
每个人都想成为大V (VIP:Very Important Person),但要一点一点积累才行,先从小v做起。要求输出由小写字母v组成的大V。
输入描述:
无
输出描述:
v v
v v
v
#include<stdio.h>intmain(){printf("v v\n");printf(" v v\n");printf(" v\n");return0;}
BC03-有容乃大
描述
确定不同整型数据类型在内存中占多大(字节),输出不同整型数据类型在内存中占多大(字节)。
输入描述:
无
输出描述:
不同整型数据类型在内存中占多大(字节),具体格式详见输出样例,输出样例中的?为不同整型数据类型在内存中占的字节数。输出样例如下:
The size of short is ? bytes.
The size of int is ? bytes.
The size of long is ? bytes.
The size of long long is ? bytes.
#include<stdio.h>intmain(){printf("The size of short is %d bytes.\n",sizeof(short));printf("The size of int is %d bytes.\n",sizeof(int));printf("The size of long is %d bytes.\n",sizeof(long));printf("The size of long long is %d bytes.\n",sizeof(longlong));return0;}
描述
实现字母的大小写转换。多组输入输出。
输入描述:
多组输入,每一行输入大写字母。
输出描述:
针对每组输入输出对应的小写字母。
示例1
输入:
A
B
输出:
a
b
备注:
多组输入过程中要注意“回车”也是字母,所以要“吸收”(getchar())掉该字母。
#include<stdio.h>intmain(){char ch;while((ch=getchar())!=EOF)//UOF : end of file Ctrl+Z {//方法1putchar(ch+32);//大写转小写+32 putchar('\n');getchar();//读取缓冲区的\n//方法2printf("%c\n",ch+32);getchar();}return0;}