2017年2月1日
摘要: 趁着寒假抓紧自学C++..... 生理周期问题是比较简单的算法问题,运用到了 枚举 的思想。 人生来就有三个生理周期,分别为体力、感情和智力周期,它们的周期长度为 23 天、 28 天和33 天。每一个周期中有一天是高峰。在高峰这天,人会在相应的方面表现出色。例 如,智力周期的高峰,人会思维敏捷,精 阅读全文
posted @ 2017-02-01 19:26 hanlulu 阅读(626) 评论(0) 推荐(0) 编辑
  2017年1月20日
摘要: 链接:http://acm.hdu.edu.cn/showproblem.php?pid=1001 AC代码: #include <stdio.h>#include <stdlib.h>int main(){ int n,sum; while(scanf("%d",&n)==1) { if(n%2= 阅读全文
posted @ 2017-01-20 22:17 hanlulu 阅读(88) 评论(0) 推荐(0) 编辑
摘要: 链接 https://vjudge.net/problem/HDU-2032 杨辉三角 HDU - 2032 因为要同时控制长和宽,所以选择二维数组。 #include <stdio.h>#include <stdlib.h>int main(){ int i,j,n; int vis[100][1 阅读全文
posted @ 2017-01-20 14:18 hanlulu 阅读(93) 评论(0) 推荐(0) 编辑
摘要: Compote CodeForces - 746A 直接按比例找就行。 最初WA的代码: QAQ 写的复杂。。。 #include <stdio.h>#include<stdlib.h>int main(){ int a,b,c,i,j,k,ans; scanf("%d%d%d",&a,&b,&c) 阅读全文
posted @ 2017-01-20 13:27 hanlulu 阅读(105) 评论(0) 推荐(0) 编辑
  2017年1月19日
摘要: Theatre Square CodeForces - 1A 水题水题。。。 最开始的程序是这个,可是AC不了我也不知道为什么。。。。。。QAQ。。。 #include <stdio.h>#include<stdlib.h>int main(){ int m,n,a,ans,tmp,k,h,tep, 阅读全文
posted @ 2017-01-19 23:20 hanlulu 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 最近沉迷魔术,希望能当成一门娱乐。 1 浪漫扑克牌,怎样变出5211314的效果。 2 背对观众猜纸牌魔术。 3 找情侣牌的魔术 4 插牌并从最上面找出的魔术 阅读全文
posted @ 2017-01-19 23:05 hanlulu 阅读(136) 评论(0) 推荐(0) 编辑
  2017年1月17日
摘要: #include <stdio.h>#include<stdlib.h>int main(){ int Type,a,b[10],i=0,c=0; printf("请输入转换类型 1:十进制转二进制;2:二进制转十进制;\n"); scanf("%d",&Type); printf("请输入原数据\ 阅读全文
posted @ 2017-01-17 13:34 hanlulu 阅读(132) 评论(0) 推荐(0) 编辑
  2017年1月16日
摘要: 适合初级程序员,只要注意不要遗漏情况就好。 C语言代码如下: #include<stdio.h>#include<stdlib.h>int main(){ int n; scanf("%d",&n); if(n==0) printf("1\n"); else if(n%4==1) printf("8 阅读全文
posted @ 2017-01-16 21:43 hanlulu 阅读(92) 评论(0) 推荐(0) 编辑
摘要: 位运算 位运算的运算分量只能是整型或字符型数据,位运算把运算对象看作是由二进位组成的位串信息,按位完成指定的运算,得到位串信息的结果。 位运算符有: &(按位与)、|(按位或)、^(按位异或)、~ (按位取反)。 其中,按位取反运算符是单目运算符,其余均为双目运算符。 位运算符的优先级从高到低,依次 阅读全文
posted @ 2017-01-16 20:07 hanlulu 阅读(249) 评论(0) 推荐(0) 编辑