1 Star 0 Fork 1

saigon/Algorithms

forked from charlieshu/Algorithms 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
number2 game_未完成.cpp 1.12 KB
一键复制 编辑 原始数据 按行查看 历史
charlie 提交于 2024-01-09 00:01 . move from github to gitee
#include <iostream>
#include <cstring>
#include <conio.h>
using namespace std;
long long Fpow(long long x){
long long a=2;
long long result = 1;
while(x){
if(x&1){
result = result*a;
}
x = x>>1;
a = a*a;
}
return result;
}
int main(){
FILE *fin,*fout;
try{
fin = fopen("D:\\number2 game\\score.data","r");
int score;
fscanf(fin,"%lld",&score);
printf("your highest score in the pass:%lld",Fpow(score));
score = max(score,game());
fclose(fin);
fout = fopen("D:\\number2 game\\score.data","w");
fprintf(fout,"%lld",score);
fclose(fout);
}
catch(){
printf("Hello!Welcome to play number2 game.There are some tips for you playing:\n");
printf("1.Use \"wasd\" to let the block move\n");
printf("2.When you die,pleace use \"r\" to start-up again\n");
printf("3.When you want to quit the game,pleace enter \"q\" to exit this game");
printf("4.You can check your score on the right of the screen\n");
printf("5.If you forget these tips,you can enter \"h\" to check the \"help\"\n");
printf("Thanks for you watching.Have a great time!");
}
return 0;
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/saigonshu/algorithm.git
git@gitee.com:saigonshu/algorithm.git
saigonshu
algorithm
Algorithms
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385