problemscpp
A collection of my answers to algorithm problems in c++.
Public 成员函数 | Public 属性 | 所有成员列表
pat::b::b1080::student结构体 参考

#include <pat.h>

Public 成员函数

int get_score () const
 
bool operator< (const student &) const
 

Public 属性

int final = -1
 
string id
 
int mid_term = -1
 
int p = -1
 
int score {}
 

详细描述

在文件 pat.h490 行定义.

成员函数说明

◆ get_score()

int pat::b::b1080::student::get_score ( ) const

在文件 pat.cpp2833 行定义.

2833 {
2834 const int mt = mid_term == -1 ? 0 : mid_term;
2835 const int f = final == -1 ? 0 : final;
2836 if(mt > f) {
2837 return static_cast<int>(mt * 0.4 + f * 0.6 + 0.5);
2838 }
2839 return f;
2840 }

引用了 mid_term.

◆ operator<()

bool pat::b::b1080::student::operator< ( const student stu) const

在文件 pat.cpp2842 行定义.

2842 {
2843 if(this->score != stu.score) {
2844 return this->score > stu.score;
2845 }
2846 return this->id < stu.id;
2847 }

引用了 id , 以及 score.

类成员变量说明

◆ final

int pat::b::b1080::student::final = -1

在文件 pat.h494 行定义.

◆ id

string pat::b::b1080::student::id

在文件 pat.h491 行定义.

被这些函数引用 operator<().

◆ mid_term

int pat::b::b1080::student::mid_term = -1

在文件 pat.h493 行定义.

被这些函数引用 get_score().

◆ p

int pat::b::b1080::student::p = -1

在文件 pat.h492 行定义.

◆ score

int pat::b::b1080::student::score {}

在文件 pat.h495 行定义.

被这些函数引用 operator<().


该结构体的文档由以下文件生成: