2020软件工程作业03
| 这个作业属于哪个课程 | https://edu.cnblogs.com/campus/zswxy/software-engineering-2017-1 |
| 这个作业的要求在哪 | https://edu.cnblogs.com/campus/zswxy/software-engineering-2017-1/homework/10494 |
| 本作业目标 | 数独代码的实现 |
| 作业正文 | |
| 其他参考文献 | 搜狗,CSDN |
1.Github项目地址:https://github.com/cckkkkkk/20177678
2.表格
|
PSP2.1 | Personal Software Process Stage | 预估耗时(小时) | 实际耗时(小时) |
|---|---|---|---|
| Planning | 计划 | 3 | 4 |
| Estimate | 估计这个任务需要多少时间 | 8 | 9 |
| Development | 开发 | 9 | 9 |
| Analysis | 需求分析(包括学习新技术) | 6 | 7 |
| Design Spec | 生成设计文档 | 1 | 3 |
| Design Review | 设计复审(和同事审核设计文档) | 2 | 2 |
| Coding Standard | 代码规范(为目前的开发制定合适的规范) | 2 | 2 |
| Design | 具体设计 | 2 | 3 |
| Coding | 具体编码 | 2 | 2 |
| Code Review | 代码复审 | 3 | 2 |
| Test | 测试(自我测试,修改代码,提交修改) | 1 | 2 |
| Reporting | 报告 | 1 | 3 |
| Test Report | 测试报告 | 2 | 2 |
| Size Measurement | 计算工程量 | 2 | 3 |
| Postmortem & Process Improvement Plan | 事后总结提出过程改进计划 | 1 | 2 |
|
合计
|
45 | 55 |
3.具体思路
看了一下作业,搜狗了一下,发现找出盘面上已知两个数的两行两列,把这两个交叉点填上遍历所有行,遇见有两格已知点的,就把剩下一格补上,有的行全空的,就跳过遍历所有列,把每一列剩下那格补上就行了。
4.关键代码
填上交叉点的函数
void search()
{ int y = 6; for (int i = 0; i < 2; i++) { for (int j = 0; j < 3; j++) { if (b[i] == c[j]) y = y - c[j]; } } for (int i = 0; i < 2; i++) { for (int j = 0; j < 2; j++) { if (a[row[i]][line[j]] == 0) { a[row[i]][line[j]] = y; } } }}
行遍历函数
void hang()
{ int y = 6; for (int i = 0; i < 3; i++) { int temp = 0; for (int j = 0; j < 3; j++) { if (a[i][j] != 0) temp++; } if (temp == 2) { for (int k = 0; k < 3; k++) { if (a[i][k] != 0) { y = y - a[i][k]; } } for (int f = 0; f < 3; f++) { if (a[i][f] == 0) { a[i][f] = y; } } y = 6; } else continue; }}5.测试


6.改进程序性能
不怎么会
7.心历路程也收获
让我认清了自己,深深感受到没打好基础是什么后果。后面的学习要更加努力,严格执行学习计划。


浙公网安备 33010602011771号