Mastermate官网 香港|英国|新加坡|澳大利亚|澳门|深圳硕士研究生申请平台
摘要: C++中的变量获取值的方法一般有两种:一种是赋初值(初始化),另一种是赋值。两者之间的区别:赋初值 int a=1;赋值 int a; a=1。未经赋值或赋初值的变量,它所具有的值是无意义的,它的值是所被分配的内存空间中保留的随机值,该值是无效值,不能用来进行运算。字符'0'和字符'\0'的区别:前面一个是数字字符0,它的ASCII值是十进制数48,后面一个字符表示为ASCII码值为0的字符,该字符在程序中常被称为空字符。字符串常量和字符常量的区别:两者在内存中存放所占的空间不同。字符串常量"a"占2个字节(需要存放字符串结束符'\0 阅读全文
posted @ 2012-05-12 20:52 大嘴鸟 阅读(129) 评论(0) 推荐(0) 编辑
摘要: This is my first time to use c++ to solve the hdoj problem . from this experience , I learned how to control precision of the float . this is too important to me. As a member of my team,I am the only player always using c language to solve problems. Maybe now I need to change my role to become a C++ 阅读全文
posted @ 2012-05-12 20:17 大嘴鸟 阅读(218) 评论(0) 推荐(0) 编辑
摘要: 因式分解tn=n;for(i=2;i*i<=n;i++)//试除2~sqrt(n) if(tn%i==0){//如果能被i整除p[++cnt]=i;//保存底数e[cnt]=0;//保存指数while(tn%i==0){//计算指数e[cnt]++;tn/=i;}}}if(tn>1){//存在大于sqrt(n)的素因子p[++cnt]=tn;e[cnt]=1;} 阅读全文
posted @ 2012-05-09 00:36 大嘴鸟 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 汗 这次杯具了~~进入acm队一年了,才知道__int 64 位int64 前面竟然有两个"_" ,果断伤不起啊!!现在数一下long long 和__int64位的用法, 在gnu c中应采用的是__int64位进行编辑。在gnu c++中应当采用的是 long long 进行的编辑。可以练一下这道题 注意下!还有的就是~~~注意下输出的问题 在gun中用%I64d是可以的,在c++中应当使用的是 long long 输出采用的是 %lld 这就可以了~~~具体的可以练一下 杭电上的 3n+1这道题。http://acm.hdu.edu.cn/showproblem.ph 阅读全文
posted @ 2012-05-08 23:08 大嘴鸟 阅读(296) 评论(0) 推荐(0) 编辑
摘要: 做hdu http://acm.hdu.edu.cn/showproblem.php?pid=2047 阿牛的牛肉串有感注意方面一 测试 边界的数值 考虑会不会越界~~~注意方面二 在使用时注意这一点 如下文 直接相加 和赋值后相加不一样 //pay more attention代码:#include<stdio.h>long long a[44];long long b[44];long long sum;int main(){ int i,n; a[1]=2;b[1]=1; for(i=2;i<=40;i++) { a[i]=2*(a[i-1]+b[i-1]); b[i] 阅读全文
posted @ 2012-05-08 13:35 大嘴鸟 阅读(388) 评论(0) 推荐(0) 编辑
摘要: 杭电2032 题注意用long long 的格式尤其是计算中间的量的时候否则容易溢出;#include<stdio.h>long long int fun(int i,int j);int main(){long long int a[34][34];int i,j,k,n; for(i=0;i<=30;i++) { for(j=0;j<=i;j++) { if(j==0){a[i][j]=1;continue;} a[i][j]=fun(i,j); } } while (scanf("%d",&n)!=EOF) { for(i=0;i< 阅读全文
posted @ 2012-05-08 01:15 大嘴鸟 阅读(179) 评论(0) 推荐(0) 编辑
摘要: 湘潭邀请赛 代码与解题报告这次第一做出来的的四道题全是水题~~ 在切过之后才发现~~囧~~~还需要多切切这样的水题网上练习的地址http://acm.hunnu.edu.cn/online/?action=problem&type=list湖南师范大学 acm网站 注册个号进去~~在search 一栏打上 湘潭即会出现这个页面用gnu C++写吧~~我用gnuC 提交就出错了~~~第一题分金块开始打这样的一个表 分的是 1,2,4,8.,16,32----------“和”是 1 3 7,15,31,63------对应的切的项是 1 2 3 4 5 6举一个例子Case1例如 141 阅读全文
posted @ 2012-05-07 21:04 大嘴鸟 阅读(203) 评论(0) 推荐(0) 编辑
摘要: today , I'd like to talk about how to test our input and output. In our programme,we can copy and paste data in our programme. and here is a new way . cmd ->cf the name of one file ,the name of other file. now here is the procees ,you can follow these pictures. write down these codes to o... 阅读全文
posted @ 2012-05-06 21:42 大嘴鸟 阅读(220) 评论(0) 推荐(0) 编辑
摘要: this day has really come here,and the result is unacceptable. rank the last of all the teams. I need to make a summary of this contest. so there were so many chanleges. I will never give up my heart. summrize today's performence.and make myself become more excllent in my acmer life. summary: ... 阅读全文
posted @ 2012-05-05 21:42 大嘴鸟 阅读(169) 评论(0) 推荐(0) 编辑
摘要: this is the summary that I watch from tudou , It's deeply impressed me.I get a lot from it.here is my summary share with you.the two lesson talked about two lessons with <divide and conquer algorithm>. this impressed me alot. the second lesson talk about :first how to calculate the steps w 阅读全文
posted @ 2012-05-03 22:25 大嘴鸟 阅读(425) 评论(0) 推荐(0) 编辑
Mastermate官网 香港|英国|新加坡|澳大利亚|澳门|深圳硕士研究生申请平台