📄 dataoperate.h
字号:
//数据处理相关函数
#pragma once
#include "StdAfx.h"
#include "TreeStruct.h"
int GetSegment(int score)
{
if (score<50) return 1;
else if ((score>=50)&&(score<=59)) return 2;
else if ((score>=60)&&(score<=65)) return 3;
else if ((score>=66)&&(score<=69)) return 4;
else if ((score>=70)&&(score<=75)) return 5;
else if ((score>=76)&&(score<=79)) return 6;
else if ((score>=80)&&(score<=85)) return 7;
else if ((score>=86)&&(score<=89)) return 8;
else if ((score>=90)&&(score<=95)) return 9;
else if ((score>=96)&&(score<=100)) return 10;
else return 0;
}
string Segment2String(int segment)
{
switch (segment)
{
case 1:return "E";break;
case 2:return "D";break;
case 3:return "C";break;
case 4:return "C+";break;
case 5:return "B-";break;
case 6:return "B";break;
case 7:return "B+";break;
case 8:return "A";break;
case 9:return "AA";break;
case 10:return "AA+";break;
default:return "N/A";
}
}
int String2Segment(string st)
{
if (!strcmp(st.c_str(),"E")) return 1;
if (!strcmp(st.c_str(),"D")) return 2;
if (!strcmp(st.c_str(),"C")) return 3;
if (!strcmp(st.c_str(),"C+")) return 4;
if (!strcmp(st.c_str(),"B-")) return 5;
if (!strcmp(st.c_str(),"B")) return 6;
if (!strcmp(st.c_str(),"B+")) return 7;
if (!strcmp(st.c_str(),"A")) return 8;
if (!strcmp(st.c_str(),"AA")) return 9;
if (!strcmp(st.c_str(),"AA+")) return 10;
return 0;
}
bool PopSort(TStuData *stu, int n)
{
TStuData tmp;
if (!n) return false;
for (int i=0;i<n-1;i++)
for (int j=i+1;j<n;j++)
{
if (stu[j].StuScore<stu[i].StuScore)
{
tmp=stu[j];
stu[j]=stu[i];
stu[i]=tmp;
}
}
return true;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -