Learning Path
浏览 C 语言 相关教程与章节。
主流编程语言、数据结构、设计模式、正则与基础算法。
教程
428
C 练习实例6 C 语言经典100例 题目:用*号输出字母C的图案。 程序分析:可先用'*'号在纸上写出字母C,再分行输出。 程序源代码: 实例 [mycode3 type='cpp'] // Created by www.runoob.com on 15/11/9. // Copyright © 2015年 菜鸟教程. All rights reserved. // #include..
C 练习实例60 C 语言经典100例 题目:画图,综合例子2。(在TC中实现)。 程序分析:无。 程序源代码: // Created by www.runoob.com on 15/11/9. // Copyright © 2015年 菜鸟教程. All rights reserved. // #include 'graphics.h' #define LEFT 0 #define TOP 0 #d..
C 练习实例61 - 杨辉三角形 C 语言经典100例 题目:打印出杨辉三角形(要求打印出10行)。 程序分析: 结构如下所示: 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 实例 [mycode3 type='cpp'] // Created by www.runoob.com on 15/11/9. // Copyrig..
C 练习实例62 C 语言经典100例 题目:学习putpixel画点,(在TC中实现)。 程序分析:无。 程序源代码: // Created by www.runoob.com on 15/11/9. // Copyright © 2015年 菜鸟教程. All rights reserved. // #include 'stdio.h' #include 'graphics.h'..
C 练习实例63 C 语言经典100例 题目:画椭圆ellipse(在TC中实现)。 程序分析:无。 程序源代码: // Created by www.runoob.com on 15/11/9. // Copyright © 2015年 菜鸟教程. All rights reserved. // #include 'stdio.h' #include 'graphics.h' #..
C 练习实例64 C 语言经典100例 题目:利用ellipse and rectangle 画图(在TC中实现)。 程序分析:无。 程序源代码: // Created by www.runoob.com on 15/11/9. // Copyright © 2015年 菜鸟教程. All rights reserved. // #include 'stdio.h' #include 'gr..
C 练习实例65 C 语言经典100例 题目:一个最优美的图案(在TC中实现)。 程序分析:无。 程序源代码: 实例 [mycode3 type='cpp'] // Created by www.runoob.com on 15/11/9. // Copyright © 2015年 菜鸟教程. All rights reserved. // #include 'graphics.h'..
C 练习实例66 C 语言经典100例 题目:输入3个数a,b,c,按大小顺序输出。 程序分析:利用指针方法。 实例 [mycode3 type='cpp'] // Created by www.runoob.com on 15/11/9. // Copyright © 2015年 菜鸟教程. All rights reserved. // # include void swap(int *, in..
C 练习实例67 C 语言经典100例 题目:输入数组,最大的与第一个元素交换,最小的与最后一个元素交换,输出数组。 程序分析:谭浩强的书中答案有问题。 实例 [mycode3 type='cpp'] #include #include void fun(int *s,int n) { int i; int max=s[0]; int a=0; for(i=0;imax) { max=..
C 练习实例68 C 语言经典100例 题目:有 n 个整数,使其前面各数顺序向后移 m 个位置,最后m个数变成最前面的 m 个数。 程序分析:可以使用一个辅助数组来保存需要移动的元素,然后再将元素按照要求移动到正确的位置。 实例 1 [mycode4 type='c'] #include // 通过 shiftArray 函数来实现数组元素的移动。 void shiftArray(int arr[], int..
C 练习实例69 C 语言经典100例 题目:有n个人围成一圈,顺序排号。从第一个人开始报数(从1到3报数),凡报到3的人退出圈子,问最后留下的是原来第几号的那位。 程序分析:无。 实例 [mycode3 type='cpp'] // Created by www.runoob.com on 15/11/9. // Copyright © 2015年 菜鸟教程. All rights reserved...
C 练习实例7 C 语言经典100例 题目:输出特殊图案,请在c环境中运行,看一看,Very Beautiful! 程序分析:字符共有256个。不同字符,图形不一样。 VC6.0下出现中文乱码(原因+解决方法): 176的16进制是B0,219的16进制是DB,0xB0DB是“佰”字的内码,所以输出的就是“佰”了。 主要原因是文件信息的代码页不同,我们所使用的操作系统中文状态下的代码页,要显示扩展的ASCII码需要在437 OEM-..
C 练习实例70 C 语言经典100例 题目:写一个函数,求一个字符串的长度,在 main 函数中输入字符串,并输出其长度。 程序分析:无。 实例 [mycode3 type='cpp'] // Created by www.runoob.com on 15/11/9. // Copyright © 2015年 菜鸟教程. All rights reserved. // #include #incl..
C 练习实例71 C 语言经典100例 题目:编写input()和output()函数输入,输出5个学生的数据记录。 程序分析:无。 程序源代码: // Created by www.runoob.com on 15/11/9. // Copyright © 2015年 菜鸟教程. All rights reserved. // #include #include typedef struct{ char nam..
C 练习实例72 C 语言经典100例 题目:创建一个链表。 程序分析:无。 实例 [mycode3 type='cpp'] // Created by www.runoob.com on 15/11/9. // Copyright © 2015年 菜鸟教程. All rights reserved. // #include #include #include typedef struct LNode..
C 练习实例73 C 语言经典100例 题目:反向输出一个链表。 程序分析:无。 实例 [mycode3 type='cpp'] // Created by www.runoob.com on 15/11/9. // Copyright © 2015年 菜鸟教程. All rights reserved. // #include #include #include typedef struct LN..
C 练习实例74 C 语言经典100例 题目:连接两个链表。 程序分析:无。 实例[mycode3 type='cpp'] // Created by www.runoob.com on 15/11/9. // Copyright © 2015年 菜鸟教程. All rights reserved. // #include #include struct list { int data; ..
C 练习实例75 C 语言经典100例 题目:输入一个整数,并将其反转后输出。 程序分析:无。 实例 - 使用 strlen() [mycode3 type='cpp'] // Created by www.runoob.com on 15/11/9. // Copyright © 2015年 菜鸟教程. All rights reserved. // #include int main() { ..
C 练习实例76 C 语言经典100例 题目:编写一个函数,输入n为偶数时,调用函数求1/2+1/4+...+1/n,当输入n为奇数时,调用函数1/1+1/3+...+1/n(利用指针函数)。 程序分析:无。 实例 [mycode3 type='cpp'] // Created by www.runoob.com on 15/11/9. // Copyright © 2015年 菜鸟教程. All rig..
C 练习实例77 C 语言经典100例 题目:练习指向指针的指针(使用多级指针遍历字符串数组)。 程序分析:无。 程序源代码: 实例 [mycode3 type='cpp'] // Created by www.runoob.com on 15/11/9. // Copyright © 2015年 菜鸟教程. All rights reserved. #include #include int ma..
C 练习实例78 C 语言经典100例 题目:找到年龄最大的人,并输出。请找出程序中有什么问题。 程序分析:无。 实例 [mycode3 type='cpp'] // Created by www.runoob.com on 15/11/9. // Copyright © 2015年 菜鸟教程. All rights reserved. #include #include // 定义结构体类型,用于..
C 练习实例79 C 语言经典100例 题目:字符串排序。 程序分析:无。 程序源代码: 实例[mycode3 type='cpp'] // Created by www.runoob.com on 15/11/9. // Copyright © 2015年 菜鸟教程. All rights reserved. #include #include #include #define MAX_LEN ..
C 练习实例8 C 语言经典100例 题目:输出 9*9 口诀。 程序分析:分行与列考虑,共 9 行 9 列,i 控制行,j 控制列。 程序源代码: 实例 [mycode3 type='cpp'] // Created by www.runoob.com on 15/11/9. // Copyright © 2015年 菜鸟教程. All rights reserved. // #include i..
C 练习实例80 C 语言经典100例 题目:海滩上有一堆桃子,五只猴子来分。第一只猴子把这堆桃子平均分为五份,多了一个,这只 猴子把多的一个扔入海中,拿走了一份。第二只猴子把剩下的桃子又平均分成五份,又多了 一个,它同样把多的一个扔入海中,拿走了一份,第三、第四、第五只猴子都是这样做的, 问海滩上原来最少有多少个桃子? 程序分析:无。 程序源代码: 实例 [mycode3 type='cpp'] // ..