题型
星河泛起
也无风雨也无晴
展开
-
我的C语言之路3
对于这道题:输出9*9乘法口诀表,我们应该如何解决呢? 如果只是输出简单的表,我们给出以下代码: #include int main() { int i = 0; for (i = 1; i { int j = 0; for (j = 1; j { printf("%d*%d=%2d ",i,j,i*j); } printf("\n"); } system("原创 2016-03-17 13:21:06 · 246 阅读 · 0 评论 -
一个简单的猜数字游戏
猜数字游戏 #include #include #include void play_game() { srand((unsigned)time(NULL)); int ret = rand() % 101; int input = 0; while (1) { printf("请猜数字:"); scanf_s("%d", &input); if (input {原创 2016-03-27 20:15:19 · 561 阅读 · 0 评论 -
关于三步翻转法的小题
有一个字符数组的内容为:"student a am i", 请你将数组的内容改为"i am a student". 不能使用库函数。只能开辟有限个空间(空间个数和字符串的长度无关)。 三步翻转法! #include #include void reverse(char* start, char* end) { assert(start); assert(end); while原创 2016-04-10 18:31:14 · 273 阅读 · 0 评论 -
在终端输入多行信息并且查找需要的信息且打印出含有该信息的行(不使用库函数)
在终端输入多行信息,找出包含“ould”的行(也可以自定义其他的查找信息),并打印该行。 #include #include #define LINE_MAX 1000 char *fine_sub_str(char *line, char *substr)//在不允许调用库函数的情况下自己写出相当于strstr的函数。 { char *str1 = line; char *str2原创 2016-04-10 19:28:14 · 342 阅读 · 0 评论