188宝金博页面版

  • 图案背景
  • 纯色背景
视图
标记
批注
批注本地保存成功,开通会员云端永久保存 去开通
putiliaozu

上传于:2012-05-12

粉丝量:0

该文档贡献者很忙,什么也没留下。


  • 相关
  • 目录
  • 笔记
  • 书签

188宝金博页面版:更多相关文档

  • 记忆测试11

    星级: 1 页

  • 记忆测试系统(java)

    星级: 24 页

  • 记忆测试软件

    星级: 4 页

  • 瞬间记忆测试

    星级: 7 页

  • 药理学-听课记忆测试》答案

    星级: 28 页

  • 中考单词记忆测试

    星级: 5 页

  • 记忆测试游戏--JAVA课程设计报告

    星级: 7 页

  • 记忆测试

    星级: 297 页

  • 秘书案例及记忆测试

    星级: 4 页

  • 记忆测试系统的设计

    星级: 25 页

  • 安全188宝金博页面版记忆测试题

    星级: 1 页

暂无目录

点击鼠标右键菜单,创建目录

暂无笔记

选择文本,点击鼠标右键菜单,添加笔记

暂无书签

在左侧文档中,点击鼠标右键,添加书签

188宝金博页面版: C记忆测试游戏

下载积分: 0

内容提示: 20120512175931_pjJjK8HJ. txt #include<stdio. h> #include<ctype. h> #include<stdlib. h> #include<time. h> int main(void) { /* records if another game is to be played */ char anotherGame = ' Y' ; /*check the squence you input is right or not*/ bool correct =true; /*number of the squences you enter is right*/ int counter = 0; int squenceLength = 0; time_t seed = 0; int number=0; int timeTaken = 0; time_t now = 0; /* rest of the declarations for program*/ /* describe how the game is played*/ printf("...

文档格式:TXT | 页数:2 | 浏览次数:8 | 上传日期:2012-05-12 17:59:31 | 文档星级:
20120512175931_pjJjK8HJ. txt #include<stdio. h> #include<ctype. h> #include<stdlib. h> #include<time. h> int main(void) { /* records if another game is to be played */ char anotherGame = ' Y' ; /*check the squence you input is right or not*/ bool correct =true; /*number of the squences you enter is right*/ int counter = 0; int squenceLength = 0; time_t seed = 0; int number=0; int timeTaken = 0; time_t now = 0; /* rest of the declarations for program*/ /* describe how the game is played*/ printf("\nTo play the Simon game, \n\n" "you should watch the digitals displayed on screen\n\n" "the digitals just displayed for 1 second then disappeared\n\n" "Now you should input your remembers Watch out for spaces! \n\n" "\"Good luck for you! \"\n") ; do{ /*code to play the game*/ correct = true; counter = 0; squenceLength = 1; timeTaken = clock() ; while( correct) { if((counter ++) % 3 == 0) squenceLength ++; seed = time(NULL) ; srand( seed) ; now = clock() ; printf("\n") ; for( int i=0; i<squenceLength; i++) { printf("%d", rand() %10) ; } /*wait for a second and esre the squence */ for( ; clock() -now <CLOCKS_PER_SEC; ) ; printf("\r") ; for(int k=0; k<squenceLength; k++) { printf(" ") ; } if(counter == 1) printf("\n Now you enter the squence don' t forget " "the spaces! \n") ; else printf("\r") ; /* you input the squence */ srand(seed) ; for(int j =0; j<squenceLength; j++) { scanf("%d", &number) ; if(number ! = (rand() % 10) ) { correct = false; break; } } printf("\n%s", correct ? "Correct! " : "Wrong! ") ; } /*out put the score when the game is finished*/ timeTaken = (clock() - timeTaken) /CLOCKS_PER_SEC; printf("\n\nYou score is %d", --counter *100 / timeTaken) ; fflush(stdin) ; /*check if a new game is required*/ 第 1 页

阅读了该文档的用户还阅读了这些文档

188宝金博页面版:关注我们

  • 新浪微博

关注188宝金博页面版公众号

188宝金博页面版
阅读
APP
阅读
返回
顶部
188宝金博页面版官网登录在线平台入口(2026已更新)—江苏协昌电子科技股份有限公司