摘要:错误消息number 个无法解析的外部命令错误 LNK1120 为您提供该链接的无法解析的外部对象数 (number)。导致无法解析的外部对象的条件由错误LNK2001描述,此错误出现在该错误信息之前(对每个无法解析的外部对象都出现一次)。虽然msdn上面说了很多原因,但我的是,新建项目时,可能没有选择控制台应用程序,重新建立了控制台应用程序,运行就成功了。 阅读全文
Tower of hanoi问题学习
2012-03-17 00:26 by youxin, 372 阅读, 0 推荐, 收藏,
摘要:hanoi问题描述如下:三根杠,a,b,c,a盘上有n个盘子,盘的尺寸由下到上依次变小要把n个盘子由a杆借助c杆移动到b杆,要求有两条:1,依次只能移动一个盘2,不允许大盘放在小盘上面用递归解题方法如下:程序如下:#include<stdio.h>void hanoi(int n,char a,char b,char c);int main(){ int n; printf("请输入盘子的个数\n"); scanf("%d",&n); hanoi(n,'a','b','c');}void 阅读全文
vc下找不到#include <graphics.h>
2012-03-16 19:49 by youxin, 20527 阅读, 2 推荐, 收藏,
摘要:如果头文件有这个,#include <graphics.h>,编译时会显示Cannot open include file: 'graphics.h': No such file or directory原因是graphics.h是Tc中专有的,<graphics.h>这个头文件不是标准C的头文件,vc下没有这个头文件,画图用控件来。还是有办法在vc下用的,就是把这个头文件和相关文件放在相应的lib和include目录下,有人制作了一个软件包,EasyX_2011惊蛰版http://www.easyx.cn,里面有头文件和安装方法,我只是把文件放在对应目 阅读全文
horner's rule霍纳法则及综合除法
2012-03-15 23:15 by youxin, 1279 阅读, 0 推荐, 收藏,
摘要:首先参考 horner's rule:http://en.wikipedia.org/wiki/Horner_scheme在synthetic divisions :http://en.wikipedia.org/wiki/Ruffini%27s_rulepn(x)=anx^n+a(n-1)*X^(n-1)+.....+a1*x+a0;归纳:1基础部:n=0; 有p0=an;2,归纳不:对任意的k,1using namespace std;float horner(int a[],float x,int n){ float result=0; for(int i=n;i>=0;i 阅读全文
基于递归的整数幂的计算
2012-03-15 21:26 by youxin, 756 阅读, 0 推荐, 收藏,
摘要:首先来看一个简单的计算n阶乘的例子:int factorial(int n){ if(n==0) return 1; else return n*factorial(n-1);}程序虽然简单,确反应了递归的基本思想。计算整数幂的的函数,如求a的n次幂。要分n为odd和even1.odd a^n=a^(n/2) * a^(n/2)*a;2.even a^n=a^(n/2)*a^(n/2)基于这点源码如下:#includeint power(int a,int n){ if(a%2==0) { if(n==1) ... 阅读全文
VS2010安装帮助文档
2012-03-14 21:19 by youxin, 1572 阅读, 0 推荐, 收藏,
摘要:刚装vs2010事系统被没有自动安装msdn,msdn帮助文档是在ProductDocumentation文件夹下,启动vs2010,选择帮助==》manage help setting=>,然后选择光盘文件夹ProductDocumentation下的HelpContentSetup.msha,然后有提示安装的帮助项目,帮你想要的安装项目选上就可以了。 有一个问题,我装完后按F!还是跳转到网络版的msdn,怎么回事?最后经过一阵折腾,终于发现了,原来我的帮助文档首选的是网络版本,所以虽然本地有,可是总是跳到网络版本。选择mange help setting 点击右上角的设置(不起眼,很 阅读全文
php 产生验证码
2012-03-11 21:52 by youxin, 322 阅读, 0 推荐, 收藏,
摘要:<?php session_start();header("Content-type:image/png");srand((double)microtime()*1000000);$imagewidth=160;$imageheight=40;$image=imagecreate($imagewidth,$imageheight);$background_color=imagecolorallocate($image,200,200,200); //gray$white = imagecolorallocate($image, 255, 255, 255);$blac 阅读全文
imagecreate()与imagecreatetruecolor()区别
2012-03-11 17:47 by youxin, 2084 阅读, 0 推荐, 收藏,
摘要:首先让我们来看下官方文档的说明: imagecreate—Create a new palette based imageresourceimagecreate(int$width,int$height)imagecreate()returns an image identifier representing a blank image of specified size.We recommend the use ofimagecreatetruecolor(). imagecreatetruecolor—Create a new true color imageresourceimagec. 阅读全文
php mail函数一段好的代码
2012-03-10 15:14 by youxin, 378 阅读, 0 推荐, 收藏,
摘要:<?php include('includes/title.inc.php'); ?><?php if(array_key_exists('send',$_POST)&&!$emaliSent){ $to = '1suming1@gmail.com,1suming@sina.com'; // use your own email address $subject = 'Feedback from Japan Journey site'; // process the $_POST variable 阅读全文
浙公网安备 33010602011771号