1 /* Note:Your choice is C IDE */ 2 #include "stdio.h" 3 #include 4 #include 5 void main() 6 { 7 int i,j; 8 srand((unsigned)time(NULL));//生成不重复的随机数std... ...
分类:
其他好文 时间:
2017-11-13 23:04:39
阅读次数:
123
猜数游戏,要求: (1)编写一个方法用于产生1-1000之间的随机数; (2)编写一个方法用于完成两个数的比较,参数(随机数,用户提供的数字),返回值: >0 用户提供的数字比随机数大 =0 用户提供的数字跟随机数一样大 <0 用户提供的数字比随机数小 (3)编写一个测试方法,为用户提供猜数字游戏过 ...
分类:
其他好文 时间:
2017-09-25 23:57:33
阅读次数:
437
猜数字程序: #Author:Mego age_mego =30 count =0 while count <3: guess_age =int(input("请输入想猜的数字:")) if guess_age==age_mego: print("输入的数字正确!") break elif gues ...
分类:
编程语言 时间:
2017-07-22 15:29:36
阅读次数:
198
num=counter=counter2=i():counter<:
num_input=(())
(,counter,i,counter2)
num==num_input:
()
num>num_input:()
num<num_input:
()
counter>=counter2<:
input2=()
input2==:
counter=:
()
counter2==:
()
counter+=counter2+=
分类:
其他好文 时间:
2017-06-02 01:19:07
阅读次数:
146
#需求:测试历史记录,一个猜字游戏,能在重新进入游戏时查看输入历史# 但是好比浏览器的播放记录,不能无限制查询以往输入。用到队列 ...
分类:
编程语言 时间:
2017-05-10 21:23:43
阅读次数:
197
最近学习批处理,看到一个大神写得猜字游戏,看懂了之后也仿了一个一模一样的,今天就来说道说道。先看下源码和效果图。
@echo off
color 0f
mode con:cols=55 lines=30
title 猜数字游戏 By leo
echo.&echo.
echo.&echo ***** 游戏规则 *****
echo.&echo 程序会自动生成一组四...
分类:
其他好文 时间:
2016-04-06 09:47:55
阅读次数:
417
#include<stdio.h>#include<stdlib.h>#include<time.h>intmain(){ intinput=1; printf("欢迎使用猜数字游戏\n"); while(input) { printf("**********************\n"); printf("*******1.start******\n"); printf("*******0.exit******\n"); printf("*******..
分类:
编程语言 时间:
2015-10-28 07:12:19
阅读次数:
181
大家一起来玩一个小游戏吧!srand((unsignedint)time(NULL));//设置随时间变化的随机数ret=rand()%100;//产生0~100随机数添加#include<time.h>改变100的值,使其产生0~其他的随机数.自定义游戏菜单menu.#include<stdio.h>
#include<stdlib.h>
#include<ti..
分类:
编程语言 时间:
2015-10-15 06:34:57
阅读次数:
279