📄 fenshuxianshi.cpp
字号:
// fenshuxianshi.cpp : 实现文件
//
#include "stdafx.h"
#include "计分程序 by WS.h"
#include "fenshuxianshi.h"
#include ".\fenshuxianshi.h"
// fenshuxianshi 对话框
IMPLEMENT_DYNAMIC(fenshuxianshi, CDialog)
fenshuxianshi::fenshuxianshi(CWnd* pParent /*=NULL*/)
: CDialog(fenshuxianshi::IDD, pParent)
, cfenshu(0)
{
}
void fenshuxianshi::xianshifenshu(CString xuhao,int qudiaofen,int pingweishu){
CString sql="select top 1 * from fenshu where suoshuxuanshou ="+xuhao+"";
db.databaseconn();
db.datasearcher(sql);
if(!db.getrs()->adoeof){
Cfenshu[0]=db.getrs()->GetFields()->GetItem("pingwei1")->GetValue();
Cfenshu[1]=db.getrs()->GetFields()->GetItem("pingwei2")->GetValue();
Cfenshu[2]=db.getrs()->GetFields()->GetItem("pingwei3")->GetValue();
Cfenshu[3]=db.getrs()->GetFields()->GetItem("pingwei4")->GetValue();
Cfenshu[4]=db.getrs()->GetFields()->GetItem("pingwei5")->GetValue();
Cfenshu[5]=db.getrs()->GetFields()->GetItem("pingwei6")->GetValue();
Cfenshu[6]=db.getrs()->GetFields()->GetItem("pingwei7")->GetValue();
Cfenshu[7]=db.getrs()->GetFields()->GetItem("pingwei8")->GetValue();
Cfenshu[8]=db.getrs()->GetFields()->GetItem("pingwei9")->GetValue();
Cfenshu[9]=db.getrs()->GetFields()->GetItem("pingwei10")->GetValue();
Cfenshu[10]=db.getrs()->GetFields()->GetItem("pingwei11")->GetValue();
Cfenshu[11]=db.getrs()->GetFields()->GetItem("pingwei12")->GetValue();
Cfenshu[12]=db.getrs()->GetFields()->GetItem("pingwei13")->GetValue();
Cfenshu[13]=db.getrs()->GetFields()->GetItem("pingwei14")->GetValue();
Cfenshu[14]=db.getrs()->GetFields()->GetItem("pingwei15")->GetValue();
Cfenshu[15]=db.getrs()->GetFields()->GetItem("pingwei16")->GetValue();
Cfenshu[16]=db.getrs()->GetFields()->GetItem("pingwei17")->GetValue();
Cfenshu[17]=db.getrs()->GetFields()->GetItem("pingwei18")->GetValue();
Cfenshu[18]=db.getrs()->GetFields()->GetItem("pingwei19")->GetValue();
Cfenshu[19]=db.getrs()->GetFields()->GetItem("pingwei20")->GetValue();
Cfenshu[20]=db.getrs()->GetFields()->GetItem("pingwei21")->GetValue();
Cfenshu[21]=db.getrs()->GetFields()->GetItem("pingwei22")->GetValue();
Cfenshu[22]=db.getrs()->GetFields()->GetItem("pingwei23")->GetValue();
Cfenshu[23]=db.getrs()->GetFields()->GetItem("pingwei24")->GetValue();
Cfenshu[24]=db.getrs()->GetFields()->GetItem("pingwei25")->GetValue();
Cfenshu[25]=db.getrs()->GetFields()->GetItem("pingwei26")->GetValue();
Cfenshu[26]=db.getrs()->GetFields()->GetItem("pingwei27")->GetValue();
Cfenshu[27]=db.getrs()->GetFields()->GetItem("pingwei28")->GetValue();
Cfenshu[28]=db.getrs()->GetFields()->GetItem("pingwei29")->GetValue();
Cfenshu[29]=db.getrs()->GetFields()->GetItem("pingwei30")->GetValue();
}
for(int i=0;i<29;i++){
for(int j=i;j<28;j++){
if(Cfenshu[j]<Cfenshu[j+1]){
float temp=Cfenshu[j];
Cfenshu[j]=Cfenshu[j+1];
Cfenshu[j+1]=temp;
}
}
}
for(int i = 0 ;i<=qudiaofen;i++){
Cfenshu[i]=0;
Cfenshu[pingweishu-i]=0;
}
float tempfen=0;
for(int i=0;i<30;i++){
tempfen+=Cfenshu[i];
}
tempfen/=(pingweishu-qudiaofen);
}
fenshuxianshi::~fenshuxianshi()
{
}
void fenshuxianshi::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_STATIC_info, info);
DDX_Control(pDX, IDC_STATIC_fen, fenshu);
DDX_Control(pDX, IDC_STATIC_fen1, fen);
DDX_Text(pDX, IDC_STATIC_fen, cfenshu);
}
BEGIN_MESSAGE_MAP(fenshuxianshi, CDialog)
END_MESSAGE_MAP()
// fenshuxianshi 消息处理程序
void fenshuxianshi::OnOK()
{
// TODO: 在此添加专用代码和/或调用基类
}
BOOL fenshuxianshi::OnInitDialog()
{
CDialog::OnInitDialog();
CFont *font;
font=new CFont;
font->CreateFont(48,0,0,0,700,0,0,0,
ANSI_CHARSET,OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS,
DEFAULT_QUALITY,
DEFAULT_PITCH|FF_DONTCARE,
"黑体");
info.SetFont(font);
fenshu.SetFont(font);
fen.SetFont(font);
// TODO: 在此添加额外的初始化
return TRUE; // return TRUE unless you set the focus to a control
// 异常: OCX 属性页应返回 FALSE
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -