pxxfxxxxx

导航

2019年4月18日 #

(for述句)韩信点兵中的最大值问题

摘要: 韩信点兵找第三个小的练习 10.6质数判断练习 1. N = 7Yes Process returned 0 (0x0) execution time : 2.835 sPress any key to continue. 2. 11.1 9x9连乘(9X9的正方形) 11.2 用文字绘制空心长方形 阅读全文

posted @ 2019-04-18 20:09 pxxfxxxxx 阅读(268) 评论(0) 推荐(0) 编辑

2019年4月17日 #

(while述句)求不定个数正整数和

摘要: do-while 和 while的区别在于do-while至少做一次 而如果是while的话不执行 阅读全文

posted @ 2019-04-17 19:29 pxxfxxxxx 阅读(264) 评论(0) 推荐(0) 编辑

2019年4月15日 #

(使用if-else述句)对多个变数求最大值的练习

摘要: switch 述句 如: 练习:消费金额计算的练习(使用switch述句) 阅读全文

posted @ 2019-04-15 17:30 pxxfxxxxx 阅读(384) 评论(0) 推荐(0) 编辑

(if述句)用两个变数的数值交换对三个变数做排序

摘要: #include int main() { int a,b,c,t; scanf("%d%d%d",&a,&b,&c); printf("Before :%d %d %d\n",a,b,c); if (b > a) { t = b; b = a; a = t; } if (c < a) ... 阅读全文

posted @ 2019-04-15 16:20 pxxfxxxxx 阅读(185) 评论(0) 推荐(0) 编辑

2019年4月8日 #

字元大小写转换

摘要: 编码:不同型别的字元对应不同的ASCAII码, 如: 'A' + 1 得到 'B' 'A' + '1' 得到 'r' 阅读全文

posted @ 2019-04-08 17:34 pxxfxxxxx 阅读(172) 评论(0) 推荐(0) 编辑

整数与浮点数型别间的转换

摘要: 一个房间类型对应里面的数据都是该类型! 注:1.如果没有3.(一个数后面加个点.预设为double型)就是3变成3.000000存入double average 中 2.printf里面的输出格式与要输出的内容一致。如果这里是%d就得不到想要的结果。 阅读全文

posted @ 2019-04-08 16:36 pxxfxxxxx 阅读(405) 评论(0) 推荐(0) 编辑

2019年4月1日 #

分治求二分法

摘要: #include using namespace std; template int BinarySearch(Type a[], const Type &x, int n) { //在a[0] a[middle]) { left = middle+1; } else { right = middle-1... 阅读全文

posted @ 2019-04-01 16:34 pxxfxxxxx 阅读(143) 评论(0) 推荐(0) 编辑

棋盘覆盖法

摘要: 过程代码 #include <iostream> using namespace std; const int BOARD_SZ = 8; static int tile = 1; static int board[BOARD_SZ][BOARD_SZ] = {0}; void chess_boar 阅读全文

posted @ 2019-04-01 15:42 pxxfxxxxx 阅读(174) 评论(0) 推荐(0) 编辑

2019年3月31日 #

两个整数,求他们的最小公倍数和最大公约数

摘要: #include void main() { int a,b,n1,n2,t; printf("任意输入两个正整数:\n"); scanf("%d%d",&n1,&n2); if(n1<n2) { t = n1; n1 = n2; n2 = t; ... 阅读全文

posted @ 2019-03-31 11:07 pxxfxxxxx 阅读(440) 评论(0) 推荐(0) 编辑

2019年3月29日 #

山:以十进制转换为二进制为例

摘要: //以十进制转换为二进制为例 #include <stdio.h> void main() { int store[30]; int a,i=0; printf("ENTER A NUMBER,PLEASE:"); scanf("%d",&a); while(a!=0) { // 如果是八进制或十六 阅读全文

posted @ 2019-03-29 22:08 pxxfxxxxx 阅读(130) 评论(0) 推荐(0) 编辑