摘要: #include #include using namespace std; //求每一位总和 int add(int m) { int sum = 0; int bc = 0; int p, q = m; while (q > 0) { p = q % 10; sum += p; q = q / 10; }... 阅读全文
posted @ 2019-02-24 20:49 Kiss_the_rain 阅读(651) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2019-02-24 20:20 Kiss_the_rain 阅读(117) 评论(0) 推荐(0) 编辑
摘要: 转自 https://www.cnblogs.com/1138720556Gary/p/9323016.html 第一人称漫游场景 地形漫游系统: (自己绘制的GIF文件超过20MB放不上博客园。截取了几张图片)按键盘上的“上下左右”可以控制第一人称的漫游视角 资源包和项目源文件:传送门 自己做的项 阅读全文
posted @ 2019-02-22 22:49 Kiss_the_rain 阅读(345) 评论(0) 推荐(0) 编辑
摘要: #include #include using namespace std; char a[80]; int sc[80]; int main() { int i, sum = 0; while (scanf("%s", a) == 1)//注意s前无&用这种方法碰到空格tab等就会结束 用getchar/fgetc(stdin) { for (i = 0... 阅读全文
posted @ 2019-02-17 21:53 Kiss_the_rain 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 测试 阅读全文
posted @ 2019-02-07 21:03 Kiss_the_rain 阅读(220) 评论(0) 推荐(0) 编辑
摘要: #include "stdafx.h" #include #define maxn 20 int a[maxn][maxn]; using namespace std; int main() { int n, x, y, tot = 0; scanf("%d", &n); memset(a, 0, sizeof(a));//数组初始化为0 tot = a[x = ... 阅读全文
posted @ 2019-02-05 18:35 Kiss_the_rain 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 平面上有两个矩形,它们的边平行于直角坐标系的X轴或Y轴。对于每个矩形,我们给出它的一对相对顶点的坐标,请你编程算出两个矩形的交的面积。 阅读全文
posted @ 2019-02-01 20:05 Kiss_the_rain 阅读(620) 评论(0) 推荐(0) 编辑
摘要: 开灯问题: 阅读全文
posted @ 2019-01-27 18:11 Kiss_the_rain 阅读(101) 评论(0) 推荐(0) 编辑
摘要: 声明两个变量fin和fout,使输入流源和输出流目标定向为文件,其余用法和scanf,printf类似 阅读全文
posted @ 2019-01-20 18:31 Kiss_the_rain 阅读(107) 评论(0) 推荐(0) 编辑
摘要: clock()为计时函数,要引入<time.h>库 其功能为返回从程序运行开始到打印出的时间 除以常数CLOCKS_PRE_SEC后得到的值以秒为单位。 阅读全文
posted @ 2019-01-20 17:53 Kiss_the_rain 阅读(151) 评论(0) 推荐(0) 编辑