- 博客(16)
- 资源 (19)
- 收藏
- 关注
原创 VS2010创建第一个C程序
<br />VS2010创建第一个C程序<br /><br /><br /><br />1)打开VS2010à“新建项目”à“空项目”à输入名称“Hello World”<br />2)在弹出的“解决方案资源管理器”中右击工程名“Hello World”à“添加”à“新建项”,输入名称Hello World.c。注意这里一定要加上后缀名.c,否则会变成c++程序。<br />3)在弹出的Hello World.c文件中添加代码:<br />#include<stdio.h><br />void main()
2010-10-19 23:05:00 1434
原创 将阿拉伯数字转化为中文数字,如12“一十二”
将阿拉伯数字转化为中文数字,如12à“一十二”<br />1)考虑不包含0的数字<br />#include<stdio.h><br />void main()<br />{<br /> int m;<br /> int c[10];<br /> int i = 0;<br /> char a[10][3] = {"零", "一", "二", "三", "四", "五", "六", "七", "八", "九"};<br /> char b[10][3] =
2010-07-24 14:38:00 885
原创 十进制正数或负数转化为二进制
#includevoid printBinary( int x){ int i; int j =0; int a[32]={0}; // if x is an integer if(x>0) { while(x) { a[j++] = x % 2; x = x / 2 ; } } // else i
2010-07-20 00:36:00 826
原创 毕业两周年记
<br />毕业两周年记<br />2010-7-12<br /> <br />流年似水,已经毕业两年了。<br />记得大学第四个学期,有一段时间我在疯狂地练打字,因为我当时怕毕业后找不到工作,如果打字够快的话就可以在毕业后当个打字员谋生。当时每天晚自习回去就练五笔打字,练了一个多月,达到每分钟100个左右(用打字软件测的),这个速度离打字员就差一点点了。有一次我姐知道了,说“你怎么就那点出息?”。<br />后来就没再坚持下去了,所以打字速度恐怕是再也没有突破过100个。<br />而今,毕业两年了。看
2010-07-20 00:35:00 473
原创 TopCoder算法竞赛题6:SRM 150 DIV 2, 250-point
Problem StatementWhen a widget breaks, it is sent to the widget repair shop, which is capable of repairing at most numPerDay widgets per day. Given a record of the number of widgets that arrive at t
2010-02-03 12:44:00 783
原创 TopCoder算法竞赛题5:SRM 149 DIV 2, 250-point
Problem StatementIn documents, it is frequently necessary to write monetary amounts in a standard format. We have decided to format amounts as follows:the amount must start with $the amount sh
2010-02-03 12:42:00 520
原创 TopCoder算法竞赛题4:SRM 148 DIV 2, 250-point
Problem StatementCreate a class DivisorDigits containing a method howMany which takes an int number and returns how many digits in number divide evenly into number itself. DefinitionClass: Div
2010-01-26 23:46:00 482
原创 TopCoder算法竞赛题3:SRM 147 DIV 2, 250-point
Problem StatementJulius Caesar used a system of cryptography, now known as Caesar Cipher, which shifted each letter 2 places further through the alphabet (e.g. A shifts to C, R shifts to T,
2010-01-26 23:45:00 578
原创 TopCoder算法竞赛题2:SRM 146 DIV 2, 250-point
Problem StatementThis task is about the scoring in the first phase of the die-game Yahtzee, where five dice are used. The score is determined by the values on the upward die faces after a roll. The
2010-01-26 23:44:00 593
原创 TopCoder算法竞赛题1:SRM 144 DIV 2, 250-point
Problem StatementComputers tend to store dates and times as single numbers which represent the number of seconds or milliseconds since a particular date. Your task in this problem is to write a meth
2010-01-26 23:43:00 593
原创 理解C语言中的指针(一)
问题:(*p)++、*p++、 *(p++)、p++的含义。 1) 先理解p与*p的区别:#includeint main(void){ int *p; int a = 4; p = &a; printf("%d/n", p); printf("%d/n
2010-01-09 22:14:00 542 2
原创 轩辕互动Exoweb笔试题(三)
轩辕互动机试题(2010-01-05 15:00~16:00) 1 求一个整型数组里不重复的数的个数。例如数组{2, 1, 1, 2, 3, 1}中的不重复的个数为3。提供的函数原型为int Stat(int a[], int n) { }解法一:#includeusing namespace std; int Stat(int a[], int n){
2010-01-07 22:28:00 1499
原创 递归思想分析----以一个简单的例子为例
递归算法分析----以一个最简单的例子为例题目:用递归的方法将整数按高到低位输出相应的数字字符.例如,对整数603,将输出3个数字6,0,3.源程序:#includeint main(void){ void fun(int); int n; scanf("%d",&n); if(n {
2010-01-06 13:50:00 486
原创 轩辕互动Exoweb笔试题(二):小猪吃米
1 小猪吃米题目:在国际象棋的棋盘上面有 NxN个格。每个格里面有若干的米粒。一只小猪站在1x1的格里,小猪每次只能向高位的列或行移动。小猪会吃掉所经过的格子里面所有的米粒。请编写程序计算小猪能吃掉的米粒的最大值。 假设小猪从(0,0)开始到棋盘上任一点(m,n)所能吃到的最多米粒数为f(m,n),则f(m,n)满足下列关系式:f(m,n)=max{f(m,n-1),
2010-01-06 13:39:00 864
原创 轩辕互动Exoweb笔试题(一)
1 定义一个数组中,若某个值出现的次数在一半以上,则为执行者。如下数组: A[8]={1,2,2,4,2,4,2,2} 由于2出现上午次数5次大于5/8>0.5, 所以2为数组A[8]的执行者。解法一:/***************************************************************** Function: Find the
2010-01-06 13:25:00 730
原创 C++学习笔记1:构造函数和析构函数
在C++语言中,构造函数主要起初始化对象的作用。当一个对象的生命周期结束时,我们应该去释放这个对象所占用的资源,这可以利用析构函数来完成。下面我们以几个具体的例子来深入讲解C++的构造函数和析构函数。 1 构造函数#include class point{ int x; int y;public:
2009-06-21 11:58:00 1064
OpenGL超级宝典源码
2009-07-19
OpenGL超级宝典中文第二版
2009-07-19
算法导论(第二版)英文版
2009-07-11
一个程序员的经典自白
2008-11-28
Learning_C++_in_21_days
2008-11-27
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人