EE308_Lab1-2
目录
- Links
- Github link
- 1. PSP form
- 2. Problem-solving ideas
- 3. Code description
- testcode.cpp
- Keywords
- Count
- Output
- 4. Summary
Links
| The Link Your Class | https://bbs.csdn.net/forums/MUEE308FZU202201 |
|---|---|
| The Link of Requirement of This Assignment | https://bbs.csdn.net/topics/608734907 |
| The Aim of This Assignment | To achieve a program function, it can extract keywords of different levels from the C or C++ code files that are read in. |
| MU STU ID and FZU STU ID | 20123116_832001212 |
Github link
1. PSP form
| Personal Software Process Stages | Estimated time/minutes | Completed Time/minutes |
|---|---|---|
| Planning | 30 | 40 |
| Estimate | 15 | 30 |
| Development | 30 | 30 |
| Analysis | 90 | 120 |
| Design Spec | 10 | 20 |
| Design Review | 20 | 20 |
| Coding Standard | 30 | 35 |
| Design | 50 | 90 |
| Coding | 120 | 180 |
| Code Review | 10 | 15 |
| Test | 20 | 20 |
| Postmortem & Process Improvement Plan | 30 | 60 |
| Total | 455 | 660 |
2. Problem-solving ideas

3. Code description
testcode.cpp
#include <iostream>
using namespace std;
int main() {
int i = 1;
double j = 0;
long f;
switch(i) {
case 0:
break;
case 1:
break;
case 2:
break;
default:
break;
}
switch(i) {
case 0:
break;
case 1:
break;
default:
break;
}
if (i < 0) {
if (i < -1) {}
else {}
}
else if (i > 0) {
if (i > 2){}
else if (i == 2) {}
else if (i > 1) {}
else {}
}
else {
if (j != 0) {}
else{}
}
return 0;
}
Keywords
string Keyword[32]=
{
"auto", "break", "case", "char", "const", "continue", "default", "double",
"do", "else", "enum", "extern", "float", "for", "goto", "if", "int", "long",
"register", "return", "short", "signed", "sizeof", "static", "struct",
"switch", "typedef", "union", "unsigned", "void", "volatile", "while"
};
Count
for (int i = 0; i < 32; i++ ) {
if (match(str, Keyword[i]) == 1) {
total_num++;
break;
}
}
for (int i = 0; i < 32; i++ ) {
if (match(str, Keyword[i]) == 1){
if (match(str, "switch") ) {
Case_num.push_back(case_num);
switch_num++;
case_num = 0;
}
if (match(str, "case")){
case_num++;
}
break;
}
}
if (match(str, "else if" )){
top++;
stack[top] = 2;
}
else {
if (match(str, "else")) {
if (stack[top] == 1 ) {
if_else_num++;
top--;
}
else {
if (stack[top] == 2 ) {
if_elseif_else_num++;
top--;
}
}
}
else {
if (match(str, "if")) {
top++;
stack[top] = 1;
}
}
}
Output

4. Summary
I think this task is difficult. The time I finish the report is beyond the estimated time but I have learnt a lot, such as C++ programing and github.
相关推荐
EE-308 LAB4 final version.7z
这是本次实验的压缩包
技术转移平台在优化匹配算法时,需要收集哪些类型的成功案例数据作为训练样本?.docx
科易网(厦门科易网科技有限公司)创立于2007年,是技术转移与科技创新数智化服务平台,拥有国家科技成果转化服务示范基地、国家技术转移示范机构等资质。平台以“AI+科技成果转化”为核心,整合成果、专利、专家、政策等多维数据,构建知识图谱与科创智能体,面向企业、政府、高校院所提供成果转化、技术需求对接、产业服务等数智化解决方案。截至目前,已服务全国企业超43万家,推动落地项目11800余项,总金额逾80亿元。
《机器视觉之路》|杯子往哪儿动,TCLR先不看标签配套源码
《机器视觉之路》第 13 集配套源码:TCLR 时序对比学习示例,含完整可运行源码与 README。
外盘期货高频tick字段说明外盘期货历史高频tick数据按合约记录,字段包括合约代码、交易所、时间戳、最新价、买一价、卖一价、买一量、卖一量、成交量、持仓量、开盘价、最高价、最低价、收盘价、结算价、昨
外盘期货高频tick字段说明 外盘期货历史高频tick数据按合约记录,字段包括合约代码、交易所、时间戳、最新价、买一价、卖一价、买一量、卖一量、成交量、持仓量、开盘价、最高价、最低价、收盘价、结算价、昨结算价。时间精确到tick,记录盘中价格和盘口买卖量变化,覆盖不同外盘期货合约的历史行情明细。 数据源:CMES金融数据库
国有企业如何利用数智化工具对下属多家子公司的研发创新效能进行横向对比分析?.docx
国有企业如何利用数智化工具对下属多家子公司的研发创新效能进行横向对比分析?


