var a:array[0..208,0..208] of int64; mo:int64; i,j,n,temp:longint;function guess:int64;var i,j,k,t:longint; ans:int64;begin ans:=1; for...
分类:
其他好文 时间:
2015-03-01 11:44:05
阅读次数:
105
就是用STL来模拟就行了,但是我有一个地方没注意坑了好几次:访问STL封装好的数据结构中的元素之前先判断容器是不是为空,否则会Runtime Error。#include#include#include#include#include#include#include#include#include#...
分类:
其他好文 时间:
2015-02-08 11:26:40
阅读次数:
164
如果对前面的内容理解透彻了,看到这个表达式就知道直接将y换成guess即可。博主写的函数如下:(define (improve guess x) (/(+ (* guess guess)) (* 2 guess)) 3))但是如果中写到这里就认为完成了那就错了,如果还是用书中的good-enough...
分类:
其他好文 时间:
2015-02-05 13:22:48
阅读次数:
117
本文由cocoaChina译者小组成员@TurtleFromMars 翻译自Appcoda,原作者:julian engel,原文:WatchKit Introduction: Building a Simple Guess Game编者注:再过几个月Apple Watch就要正式发布了。如你所知,...
分类:
移动开发 时间:
2015-02-03 17:04:05
阅读次数:
133
#coding:utf-8fromrandomimportrandintnum=randint(1,100)print"guesstherightnumber,sopleaseinputanumber:"a=1whilea==1:answer=input()##把输入赋值给answer以便条件中用到比较大小ifanswer<num:print"it‘stoosmall"ifanswer>num:print"it‘stoobig"ifanswer==num:prin..
分类:
编程语言 时间:
2015-01-25 19:44:32
阅读次数:
152
实在太困 题都看错先贴王大神的代码有空再做遍#include #include #include #include #include #include #include using namespace std;typedef __int64 LL;LL h,n;LL now1,now2;LL ans...
分类:
其他好文 时间:
2015-01-24 17:07:53
阅读次数:
111
Amr bought a new video game "Guess Your Way Out!". The goal of the game is to find an exit from the maze that looks like a perfect binary tree of heig...
分类:
其他好文 时间:
2015-01-24 08:57:37
阅读次数:
240
这道题比较简单。需要注意的一些地方:1、impossible: 所有的标记量都是false2、not sure:同时存在2种情况或者同时存在三种情况.Problem II Can Guess the Data Structure!There is a bag-like data structure, supporting two operations:1 xThrow an element x i...
分类:
编程语言 时间:
2014-12-28 20:51:37
阅读次数:
217
main()的2种用途:
测试真正的类启动java application
真正的java application只会让对象和对象进行交互(相互调用)。
下面的一个猜数字的游戏充分体现了以上观点:
玩家角色类:持有自己的数字number和一个guess()方法:
public class Player {
int number = 0; // 被猜测的数字
pu...
分类:
编程语言 时间:
2014-12-27 17:41:46
阅读次数:
174
import randomnum = random.randint(0,100)print numtimes = 0print "Number[0,100] guess game"print "You will have 10 times to guess"print "Guess out of r...
分类:
编程语言 时间:
2014-12-26 18:31:18
阅读次数:
257