- 博客(35)
- 资源 (5)
- 问答 (2)
- 收藏
- 关注
原创 超级马里奥大佬的作品!C++
这个是日本大佬作品太NB代码我刚刚一复制电脑:您的电脑出现一点点bug蓝屏了…………所以不复制了文件上传成功有兴趣的朋友看一下啊!看看图片:整体就是这样打开这个!!!!!!!!!!!!!!!!!!!!!!打开这个!!!!!!!!!!!!!!!!!!!!!!打开这个!!!!!!!!!!!!!!!!!!!!!!打开这个!!!!!!!!!!!!!!!!!!!!!!打开这个!!!!!!!!!!!!!!!!!!!!!!打开这个!!!!!!!!!!!!!!!!!!!!!!打开这个!!!!
2020-06-14 14:24:20
1486
原创 双人五子棋Python
文件的import sysimport pygamefrom collections import namedtuplefrom collections import dequeimport randomPosition = namedtuple('Position', ['x', 'y'])class Renju(object): background_filename = 'chessboard.png' white_chessball_filename = 'white_c
2020-06-12 21:57:23
1235
原创 2048C++(2)
制作大型2048#include <time.h> /* 包含设定随机数种子所需要的time()函数 */#include <stdio.h> /* 包含C的IO读写功能 */#include <stdlib.h> /* 包含C标准库的功能 */#ifdef _WIN32/* 包含Windows平台相关函数,包括控制台界面清屏及光标设定等功能 */#include <conio.h>#include <windows.h>
2020-07-04 12:14:46
324
原创 现在时间C++
题目:导入现在时间年 月 日时 分 秒代码#include <iostream>#include <unistd.h>using namespace std;int GetYear(int year);int GetMonth(int year, int month);void Run(int year, int &Jan);string Day(int day);string Use(int y, int m, int d);int ma
2020-07-02 13:11:28
562
原创 俄罗斯方块Python
# -*- coding: utf-8 -*- from tkinter import *import random#尚需改进,有待提高 #各种方块的表示,与参考方块的相对位置shapedic={1:((0,0),(1,0),(0,-1),(1,-1)),#正方形 2:((0,0),(0,-1),(0,-2),(0,1)),#长条 3:((0,0),(0,-1),(1,0),(1,1)),#之字型 4:((0,0),(0,-1),(-
2020-06-27 21:19:58
405
原创 矩形和点——C++青少年一级考资料
题目:判断矩形和点代码如下#include <bits/stdc++.h>using namespace std;int main(){ int x,y; cin >> x>>y; if (x<-1 || x>1 || y>1 || y<-1) { cout <<"no"; } else { cout <<"yes";
2020-06-15 22:01:15
298
原创 平年闰年——C++青少年一级考资料
题目:判断平年闰年#include <bits/stdc++.h>using namespace std;int main(){ int n; cin >> n; if (n % 4 == 0 && n % 100 != 0) { cout << "Y"; } else if (n % 400 == 0) { cout << "Y"; }
2020-06-15 21:58:46
230
原创 判断星期几——C++青少年一级考资料
题目:判断星期几输入1、3、5则输出NO,否YES简单…………#include <bits/stdc++.h>using namespace std;int main(){ int d; cin >> d; if (d==1 || d==3 || d==5) { cout<<"NO"; } else { cout << "YES"; }}..
2020-06-15 21:56:39
241
原创 翻转——C++青少年一级考资料
题目:输入:123输出:321#include <bits/stdc++.h>using namespace std;int main(){ int n; cin >> n; cout << n % 10; cout << n / 10 % 10; cout << n / 100;}
2020-06-15 21:53:09
385
原创 第二类运算——C++青少年一级考资料
题目:输出a/ba%c(笑出猪叫)#include <iostream>#include <bits/stdc++.h>using namespace std;int main(){ int a,b; cin >> a >> b; cout << a / b << " " << a % b;}
2020-06-15 21:51:12
223
原创 第一类运算——C++青少年一级考资料
题目输出CC = 5 * ( F- 32 ) / 9;(笑出猪叫)#include <bits/stdc++.h>using namespace std;int main(){ double C,F; cin >> F; C = 5 * ( F- 32 ) / 9; cout << C;}
2020-06-15 21:49:01
1436
原创 格式化(设置宽度)——C++青少年一级考资料
题目:使用setw格式化a,b,c(太水了)#include <bits/stdc++.h>using namespace std;int main(){ int a,b,c; cin >> a >> b >> c; cout << a << " " << setw(8) << b << " " << setw(8) << c; re
2020-06-15 21:45:18
210
原创 井字棋Python
题目:用Python做一个井字棋代码如下X="X"O="O"EMPTY=" "#询问是否继续def ask_yes_no(question): response=None; while response not in("y","n"): response=input(question).lower() return response#输入位置数字def ask_number(question ,low,high): response=None
2020-06-14 16:32:23
472
原创 银杏树Python画图
题目:(Python画图)画一个银杏树(美丑无所谓)代码如下from turtle import *from random import *from math import *def tree(n, l): pd() color("darkgoldenrod") pensize(n / 3) forward(l) if n > 0: b = random() * 15 + 10 c = random() * 15
2020-06-14 16:27:39
3939
3
原创 射方砖Python
题目:用Python game做一个射方砖程序import sys, pygame, random,osfrom time import*class Breakout(): def main(self): xspeed_init = 6 yspeed_init = 6 max_lives = 5 bat_speed = 30 score = 0 bgcolour = 0x2F, 0x4F, 0x
2020-06-14 16:23:27
258
原创 2048C++/C
题目做一个简单又有逼格的2048游戏如果对你有帮助请点个赞吧!#include <bits/stdc++.h>#include <unistd.h>#include <windows.h>using namespace std; void print();char n;int a[4][4]={ {1,1,1,1}, {1,1,1,1}, {1,1,1,1}, {1,1,1,1}},x,y;void say(stri
2020-06-13 10:42:10
401
原创 二维码随机生成Python
题目随机生成二维码。代码如下from qrcode import *x=input("\n请输入你想在二维码里面储存的文字:")print("\n请返回桌面查看")qr = QRCode()qr.add_data(x)删除线格式 img = qr.make_image()img.show()
2020-06-12 19:51:06
947
原创 贪吃蛇找食物C++
这个作品不是自动走是和走迷宫一样WSAD操控有个bug是有时蛇走到食物上面蛇会消失,食物还在,大佬在评论区给我说一下原因吧。#include <iostream>#include <ctime>#include <unistd.h>#include <string>#include <cstring>#include <stdlib.h>#include <set>#include <cstdli
2020-06-12 19:08:21
260
原创 推箱子C++
题目:设计一个可以通过的退箱子!是小人,o是箱子,x是目的地代码如下#include <iostream>#include <cstring>#include <cstdlib>#include <unistd.h>#include <cstdio>using namespace std;char map[5][21] ={ {'#','#','#','#','#','#','#','#','#','#
2020-06-12 19:00:59
514
原创 账号密码C++
//题目:// 你就需要一直进行输入,直到你输入正确// 为止,并提示“恭喜你登陆成功”如果对你有帮助可以点个赞代码如下#include <iostream>using namespace std;int main(){ //1.初始化,设定账号和密码。 int ID = 20050101; int password = 123456; //2.建立存储信息的变量。 int id, psd; //3.完成do-while循环
2020-06-11 20:58:02
2754
1
原创 牧羊犬的基因C++
// 题目:// 德国牧羊犬的眼睛一般为黑色和棕色。可多研究后发现,// 眼睛的颜色是由基因控制的,现在已经知道黑色眼睛的// 基因为str中存储的数据。现在又一段德国牧羊犬的眼// 睛的基因片段以存储到gene中。请你判断一下这个德国// 牧羊犬眼睛的颜色#include <iostream>#include <cstring>using namespace std;int main(){ //1.基因片段 string gene = "ATT
2020-06-11 20:55:25
193
原创 地鼠的位置C++
//使用二维数组记录地鼠的位置//使用for循环输出二维数组内容代码如下#include <iostream>using namespace std;int main(){ int hero[5][4] = { {2, 99, 98, 99}, {4, 95, 92, 85}, {6, 86, 90, 82}, {13, 97, 90, 91}, }; fo
2020-06-11 20:53:45
225
原创 迷宫地图C++
//设计一个迷宫地图#include <iostream>#include <math.h>#include <unistd.h>#include <stdlib.h>#include <adapter.week-two.h>using namespace std;int main(){ char map[6][6]= { {'#','#','#',
2020-06-11 20:51:45
861
1
原创 字符串长度C++
/*编写程序,实现从键盘输入一个长度小于100的字符串,输出字母A出现的次数。输入示例:ABVERGJEICAONCANOAXCAA输出示例:6*/#include <iostream>#include <cstring>using namespace std;int main(){ char a[100]; int sum = 0; cin >> a; //请完成下面的代码 //len为输
2020-06-11 20:50:18
307
原创 找雷游戏C++
/**找雷游戏在一个44的方形雷阵中,*每个位置随机设定是否有雷(0没有雷,1有雷)。*每次输入一个位置(行和列),*如果对应位置是草坪(安全),则继续游戏;*如果对应位置是地雷,则游戏结束。*看看你能坚持多久吧!*(用0代表初始雷阵,8代表挖地雷后安全的草坪)*任务:*1.完成每一个位置有无地雷的随机赋值*2.完成遇到地雷爆炸的判断中的语句*/#include <iostream>#include <cstdlib>using namespace st
2020-06-11 20:43:05
243
原创 自制C++/C工具库
这个文章可能没有帮助,我就不备测试地点了啊,里面有鸡兔同笼、计算机、斐波那契数列、查找字符、次方、分数加减法、大整数加减法#include <iostream>#include <bits/stdc++.h>#include <stdio.h>#include <stdlib.h>#include <unistd.h>#include <iostream>#include <cstdlib>#includ
2020-06-11 20:40:11
283
原创 大整数乘除法C++
题目要求:1.求两个数字相乘的结果是个有点麻烦的题#include <iostream>using namespace std;//字符串翻转的函数string res(string s){ int i = 0; int j = s.length() - 1; while (i < j) { swap(s[i], s[j]); i++; j--; } return s;}
2020-06-09 19:07:31
428
原创 贪心算法进阶(走好当下每一步)C++
题目描述在 2×n 的一个长方形方格中,用一种 2×1 的骨牌铺满方格。输入 n(3<=n<=40),输出铺放方案的总数。例如 n=3 时,为 2×3 方格,骨牌的铺放方案有三种,如下图所示。输入描述一个整数 n,表示长方形的长度。(3<=n<=40)输出描述一个整数,表示铺放方案的总数样例输入:3样例输出:3#include<iostream>using namespace std;int main(){ int n , x , f[
2020-06-09 18:55:27
220
原创 贪心算法基础(走好当下每一步)C++
题目描述:John 有 n 块积木(1 <= n <= 1000),每块积木有自己的高度 Hi(1 <= Hi <= 1000),John 的桌子高度为 B。积木垂直摆放可以叠加高度,当然积木的数目越少越安全,John 最少使用多少块积木就可以使积木的总高度不低于桌子呢,请你帮助 John 找到积木数目最少的方案。输入描述:第 1 行两个整数 n 和 B, 表示积木的总数目和桌子的高度。第 2到n+1 行:第 i+1 行为整数 Hi。输出描述:一行,为到达桌子高度所需要的
2020-06-09 18:53:16
417
原创 递推算法基础(从大到小解决问题)C++
题目描述在 2×n 的一个长方形方格中,用一种 2×1 的骨牌铺满方格。输入 n(3<=n<=40),输出铺放方案的总数。例如 n=3 时,为 2×3 方格,骨牌的铺放方案有三种,如下图所示。输入描述一个整数 n,表示长方形的长度。(3<=n<=40)输出描述一个整数,表示铺放方案的总数样例输入:3样例输出:3代码如下#include<iostream>using namespace std;int main(){ int n , x
2020-06-09 18:32:36
388
原创 二分答案C++
现有苹果、香蕉、梨三种水果,其中苹果188个,香蕉152个,梨324个。现在要把这些水果分给9位同学,要求每位同学仅能分到一种水果,且每人分到的水果数量一致。请设计一个程序,找到每人最多能分到多少个水果。代码如下#include <bits/stdc++.h>using namespace std;int main(){ int ans = 0; int l = 1, r = 324; while (l <= r) { int mi
2020-06-09 18:28:21
700
原创 线性递归C++
【题目描述】利用递归的方法寻找数组中的最小值。【输入描述】输入共两行;第一行,一个整数 n(1<=n<=100),n表示接下来输入数字的个数;第二行,输入 n 个整数,数字之间用空格隔开。【输出描述】输出一个数组中最小的值。【样例输入】101 2 3 4 5 6 7 8 9 10【样例输出】1代码如下#include <iostream>using namespace std; int n, a[110];// 写函数f,使用递归的方法寻找数组中的最
2020-06-09 18:23:42
355
原创 有序数组合并C++
题目描述将两个有序数组中的元素合并为一个有序的数组第一个数组:15 20 23 46 57 59第二个数组:11 17 22 33输入样例: 输出样例:无 11 15 17 20 22 23 33 46 57 59 代码如下#include <iostream>using namespace std; int main(){ int a[6] = {15, 20, 23, 46, 57, 59}; int b[4]
2020-06-09 18:17:30
640
原创 二分排序C++
快排的思路是差不多一样的,数组当中随机找支点,小于它的所有数放一边,大于它的所有数放另一边b。然后,在a,b中用差不多的思路进行排序,也就是递归。一直到基础情况,使用最基本的排序算法进行排序。代码如下#include <iostream>using namespace std; int a[110], b[110];void mergearray(int l, int m, int r){ // 左半边数组的起点下标和终点下标 int l1 = l, r1 = m;
2020-06-09 13:33:59
1141
日本大佬作品:超级马里奥(不可能是我做的).zip
2020-06-14
white_chessball.png
2020-06-13
black_chessball.png
2020-06-12
构成三角形不会做大佬看看
2020-06-19
java激活失败求解!(VSC)
2020-06-14
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅