随笔分类 -  C语言

1 2 下一页
指向结构体变量的指针的简单应用
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> #include void main() { ... 阅读全文
posted @ 2010-12-15 16:31 别人叫我军师 阅读(1559) 评论(0) 推荐(0)
若有字符串"I have 30 girl fridends.",要求输出删除字符'0'之后的字符串内容
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> #include void delchar( char ... 阅读全文
posted @ 2010-12-12 22:44 别人叫我军师 阅读(256) 评论(0) 推荐(0)
用字符串指针指向一个字符串
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> #include void fun(){ cha... 阅读全文
posted @ 2010-12-12 22:29 别人叫我军师 阅读(1612) 评论(0) 推荐(0)
用指针法输出数组中的全部元素
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> void main(){ int a[ 5 ],i;... 阅读全文
posted @ 2010-12-12 15:52 别人叫我军师 阅读(1608) 评论(0) 推荐(0)
输入三个数,按照由大到小的顺序输出
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> void swap( int * p1, int ... 阅读全文
posted @ 2010-12-12 15:24 别人叫我军师 阅读(1107) 评论(0) 推荐(0)
使用以指针变量作为形式参数,并将改变带回到调用函数
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> #include void main(){ voi... 阅读全文
posted @ 2010-12-08 22:27 别人叫我军师 阅读(929) 评论(2) 推荐(0)
输入两个整数,按照从大到小的顺序输出两个数
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> #include void main(){ ... 阅读全文
posted @ 2010-12-08 21:48 别人叫我军师 阅读(3868) 评论(0) 推荐(0)
通过指针变量访问整形变量
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> #include void main(){ int... 阅读全文
posted @ 2010-12-08 21:18 别人叫我军师 阅读(657) 评论(0) 推荐(0)
将一个字符串的字符序列置为逆序,如将"abcdef"变为"fedcba"
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> #include void main(){ int... 阅读全文
posted @ 2010-12-05 10:33 别人叫我军师 阅读(878) 评论(0) 推荐(0)
从键盘为3*3的矩阵输入数据,找出主对角线上最大的元素,以及所在的行号
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> #include void main(){ int... 阅读全文
posted @ 2010-12-03 10:07 别人叫我军师 阅读(4320) 评论(1) 推荐(0)
排序之直接插入排序
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> #include #define M 100 ... 阅读全文
posted @ 2010-11-30 20:49 别人叫我军师 阅读(824) 评论(0) 推荐(0)
排序之冒泡排序
摘要:思想:首先是将第1个数和第2个数进行比较,若为逆序(R[1]>R[2]),则交换这两个数的位置,然后比较第2个数和第3数,以此类推,直至第n-1个数和第n个数进行比较为止.这个过程称为第一趟冒泡排序,排序结果是最大的数被排在了最后。即R[n]. 接着进行第二趟冒泡排序,即对前n-1个数再次进行两... 阅读全文
posted @ 2010-11-30 12:13 别人叫我军师 阅读(486) 评论(2) 推荐(2)
排序索引
摘要:直接插入排序 希尔排序 选择排序 冒泡排序 阅读全文
posted @ 2010-11-30 11:57 别人叫我军师 阅读(198) 评论(0) 推荐(0)
猴子吃桃问题
摘要:猴子吃桃问题。猴子第一天摘下若干个桃子,当即吃了一半,还不瘾,又多吃了一个第二天早上又将剩下的桃子吃掉一半,又多吃了一个。以后每天早上都吃了前一天剩下的一半零一个。到第10天早上想再吃时,见只剩下一个桃子了。求第一天共摘了多少。 Code highlighting produce... 阅读全文
posted @ 2010-11-30 10:58 别人叫我军师 阅读(2009) 评论(0) 推荐(0)
百马百担问题
摘要:百马百担问题,有100匹马,驮100担货,大马驮3担,中马驮2担,两匹小马驮1担,编程计算共有多少种驮法? Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlig... 阅读全文
posted @ 2010-11-29 22:44 别人叫我军师 阅读(2409) 评论(0) 推荐(0)
编写代码打印一下图形
摘要:1 123 12345 1234567 123456789 Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> #incl... 阅读全文
posted @ 2010-11-29 21:54 别人叫我军师 阅读(410) 评论(0) 推荐(0)
求S=a+aa+aaa+....+aa...aaa之值,其中a是1~9之间的数字。
摘要:求Sn=a+aa+aaa+aaaa+...aa,其中a是1~9之间的数字。从键盘中输入a和n,例如:a=3,n=6时,表达式为S6=3+33+ 333+3333+33333+333333,其值为370368. Code highlighting produced by Actipro... 阅读全文
posted @ 2010-11-29 21:18 别人叫我军师 阅读(1826) 评论(1) 推荐(0)
求n!之和(即求1!+2!+3!+...+n!)
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> #include void main(){ in... 阅读全文
posted @ 2010-11-28 17:12 别人叫我军师 阅读(678) 评论(0) 推荐(0)
有一分数序列:2/1,3/2,5/3,8/5,13/8,21/13,.......,求这个数列的前20项之和
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> #include void main(){ floa... 阅读全文
posted @ 2010-11-28 16:58 别人叫我军师 阅读(1124) 评论(0) 推荐(0)
求100~1000之间个位数为6且被3整除的所有整数
摘要:代码 Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> #include void ma... 阅读全文
posted @ 2010-11-28 15:21 别人叫我军师 阅读(487) 评论(0) 推荐(0)

1 2 下一页