摘要: getch(): 所在头文件:conio.h 函数用途:从控制台读取一个字符,但不显示在屏幕上 函数原型:int getch(void) 返回值:读取的字符 例如: char ch;或int ch; getch();或ch=getch(); 用getch();会等待你按下任意键,再继续执行下面的语句; 用ch=getch();会等待你按下任意键之后,把该键字符所对应的ASCII码赋给ch,再执行下面的语句。 易错点:所在头文件是conio.h。而不是stdio.h。http://zhidao.baidu.com/question/143549364.html 阅读全文
posted @ 2013-08-05 21:29 南柯南 阅读(155) 评论(1) 推荐(0)
该文被密码保护。 阅读全文
posted @ 2013-07-12 10:25 南柯南 阅读(0) 评论(0) 推荐(0)
摘要: request.gerScheme()返回协议名称,默认是http。request.getServerName() 返回的死你浏览器中显示的主机名。getServerPort()获取服务端口号<% = request.getContexpath()%>是为了解决相对路径的问题,可返回站点的根路径 阅读全文
posted @ 2013-06-05 09:22 南柯南 阅读(152) 评论(0) 推荐(0)
摘要: Filter 技术是servlet 2.3 新增加的功能.servlet2.3是sun公司与2000年10月发布的,它的开发者包括许多个人和公司团体,充分体现了sun公司所倡导的代码开放性原则.由于众多的参与者的共同努力,servlet2.3比以往功能都强大了许多,而且性能也有了大幅提高. 它新增加的功能包括: 1. 应用程序生命周期事件控制; 2. 新的国际化; 3. 澄清了类的装载规则; 4. 新的错误及安全属性; 5. 不赞成使用HttpUtils 类; 6. 各种有用的方法; 7. 阐明并扩展了几个servlet DTD; 8. filter功能. 其中最重要的就是filter功能.它 阅读全文
posted @ 2013-05-24 16:31 南柯南 阅读(361) 评论(0) 推荐(0)
摘要: 参照:http://www.360doc.com/content/10/1010/16/3656934_59884964.shtml卡特兰计算公式:数列 a[n]=C(2n,n)/(n+1)为了计算的方便将其推导为递推公式:a[n]=((4*n-2)/(n+1))*a[n-1];将该递推式拆解为(4*n-2)与a(n-1)的乘积,再除以(n+1); 1 #include<iostream> 2 using namespace std; 3 #define SIZE 100 4 int main() 5 { 6 int a[101][SIZE]= {0}; //数组用来存放结果 并且 阅读全文
posted @ 2012-06-06 22:22 南柯南 阅读(369) 评论(0) 推荐(0)
摘要: 1 #include<iostream> 2 #include<stdlib.h> 3 #include<cmath> 4 #include<stdio.h> 5 using namespace std; 6 int n; 7 typedef struct 8 { 9 double x; 10 double y; 11 }Point; 12 13 Point p[110],s[110]; 14 15 int top; 16 17 double Mul(Point a, Point b, Point c) 18 { 19 return (b.x . 阅读全文
posted @ 2012-05-03 14:45 南柯南 阅读(230) 评论(0) 推荐(0)
摘要: 反着考虑第N个必然在a或者c上。而第N-1个必须先移到b顺次考虑下去 1 #include<iostream> 2 using namespace std; 3 4 int main() 5 { 6 freopen("output.txt","r",stdin);//从文件output.txt读入 7 freopen("input.txt","w",stdout);//写入到文件input.txt 8 int N; 9 bool flag;10 int cas;11 cin>>cas;12 阅读全文
posted @ 2012-05-03 14:45 南柯南 阅读(308) 评论(0) 推荐(0)
摘要: 题就是看规律,比如 第1行 的九个数字的特征,第2~n+1行各个数字的特征,第n+2~2*n+2行各个数字,第2*n+3行的。即可以敲心中所想了。 1 #include<iostream> 2 using namespace std; 3 4 int main() 5 { 6 //freopen("output","w",stdout); 7 int n,len,i,j,k,x; 8 char ch[9]; 9 while(scanf("%d%s",&n,ch)!=EOF) 10 { 11 if(n==0& 阅读全文
posted @ 2012-04-18 19:17 南柯南 阅读(373) 评论(0) 推荐(0)
摘要: 1 #include<iostream> 2 using namespace std; 3 4 int a[1000001]; 5 6 7 int main() 8 { 9 int n,m,max;10 __int64 i,k;11 int cnt ;12 13 for(k = 1; k <= 100000; k++)14 {15 cnt = 0;16 i = k;17 while(true)18 {19 cnt... 阅读全文
posted @ 2012-04-18 13:07 南柯南 阅读(174) 评论(0) 推荐(0)
摘要: 1 #include <stdio.h> 2 #include <math.h> 3 4 void main() 5 { 6 int a[21]; 7 int n,i; 8 double p,sum; 9 a[0] = 0; a[1] = 1;10 for(i = 2; i <= 20; i ++)11 a[i] = a[i-1] + a[i-2];12 while(scanf("%d",&n)!= EOF)13 {14 if(n <= 20)15 {16 pri... 阅读全文
posted @ 2012-04-17 18:14 南柯南 阅读(147) 评论(0) 推荐(0)