当前位置:首页>java>编程与数学||C++编程与八年级下册数学融合学习纲要

编程与数学||C++编程与八年级下册数学融合学习纲要

  • 2026-02-07 04:27:49
编程与数学||C++编程与八年级下册数学融合学习纲要

大家好,我是老刘,数学学科作为一门基础学科,新课标要求注重活动化、游戏化、生活化的学习设计;以前的【编程与数学】序列,我们充分利用图形化编程的可视化特点,将数学融合起来,作为一种创新的学习方式,可以使得数学学科的教学更加生动有趣,形象直观;

今天老刘分享C++编程与数学融合学习课程纲要,探索如何将数学知识与C++编程紧密结合?目标是先理解数学概念,再编程实现,通过完整项目整合知识点,鼓励学生结对编程,培养团队协作能力。

一、课程整体设计思路

本课程以人教版八年级下册数学知识为主线,通过C++编程实现数学概念的验证、应用和拓展,培养学生的计算思维、逻辑推理能力和问题解决能力。课程采用"数学概念→编程实现→实际应用"的三步教学模式。

二、各单元详细知识点对应表

第一单元:二次根式(4课时)

数学知识点

  1. 二次根式的概念和性质

  2. 二次根式的乘除运算

  3. 二次根式的加减运算

  4. 最简二次根式和同类二次根式

  5. 二次根式的化简与运算

C++知识点

  • 基本数据类型:double, int

  • 算术运算符和表达式

  • 条件语句:if-else

  • 数学函数库:sqrt(), pow(), fabs()

  • 循环结构:for循环

编程实践

// 二次根式计算器#include<iostream>#include<cmath>#include<iomanip>using namespace std;// 判断一个数是否为完全平方数boolisPerfectSquare(int n){    int root = sqrt(n);    return root * root == n;}// 化简二次根式voidsimplifySqrt(int n){    if(n < 0) {        cout << "负数没有实数平方根" << endl;        return;    }    if(isPerfectSquare(n)) {        cout << "√" << n << " = " << sqrt(n) << endl;        return;    }    // 寻找最大平方因子    int factor = 1;    for(int i = sqrt(n); i >= 2; i--) {        if(n % (i*i) == 0) {            factor = i;            break;        }    }    int remaining = n / (factor*factor);    if(factor == 1) {        cout << "√" << n << " 已是最简形式 ≈ " << sqrt(n) << endl;    } else {        cout << "√" << n << " = " << factor << "√" << remaining;        cout << " ≈ " << factor * sqrt(remaining) << endl;    }}intmain(){    cout << "=== 二次根式计算器 ===" << endl;    // 1. 计算平方根    cout << "\n1. 计算平方根" << endl;    for(int i = 2; i <= 20; i++) {        cout << "√" << i << " = " << sqrt(i);        if(isPerfectSquare(i)) {            cout << " (有理数)";        } else {            cout << " (无理数)";        }        cout << endl;    }    // 2. 化简二次根式    cout << "\n2. 化简二次根式" << endl;    int numbers[] = {8121820242732455072};    for(int num : numbers) {        simplifySqrt(num);    }    // 3. 二次根式运算    cout << "\n3. 二次根式运算" << endl;    double a, b;    cout << "输入两个数a和b:";    cin >> a >> b;    cout << fixed << setprecision(3);    cout << "√a + √b = " << sqrt(a) + sqrt(b) << endl;    cout << "√a - √b = " << sqrt(a) - sqrt(b) << endl;    cout << "√a × √b = " << sqrt(a) * sqrt(b) << endl;    if(b != 0) {        cout << "√a ÷ √b = " << sqrt(a) / sqrt(b) << endl;    }    // 4. 同类二次根式判断    cout << "\n4. 同类二次根式判断" << endl;    cout << "判断√8、√18、√32是否为同类二次根式:" << endl;    // 化简并比较    simplifySqrt(8);    simplifySqrt(18);    simplifySqrt(32);    // 判断方法:化简后根号内的数是否相同    cout << "化简后根号内的数都是2,所以它们是同类二次根式" << endl;    return 0;}

课后练习1

  1. 编写程序,输入一个正整数n,输出n以内的所有完全平方数

  2. 编写程序,计算两个二次根式的和,并化简结果

  3. 编写程序,判断两个二次根式是否为同类二次根式

第二单元:勾股定理(3课时)

数学知识点

  1. 勾股定理及其证明

  2. 勾股定理的逆定理

  3. 勾股定理的应用

  4. 勾股数

C++知识点

  • 函数定义与调用

  • 布尔类型和逻辑运算

  • 三重循环(用于寻找勾股数)

  • 结构体的使用

编程实践:
// 勾股定理应用#include<iostream>#include<cmath>#include<iomanip>#include<vector>#include<algorithm>using namespace std;// 定义三角形结构体struct Triangle {    double a, b, c;    bool isRight;  // 是否为直角三角形};// 检查是否为直角三角形boolisRightTriangle(double a, double b, double c){    // 对边进行排序,c为最长边    vector<double> sides = {a, b, c};    sort(sides.begin(), sides.end());    // 检查勾股定理    return fabs(pow(sides[0], 2) + pow(sides[1], 2) - pow(sides[2], 2)) < 1e-6;}// 寻找勾股数voidfindPythagoreanTriples(int limit){    cout << "\n勾股数(a² + b² = c²,a < b < c ≤ " << limit << "):" << endl;    int count = 0;    for(int c = 1; c <= limit; c++) {        for(int b = 1; b < c; b++) {            for(int a = 1; a < b; a++) {                if(a*a + b*b == c*c) {                    cout << ++count << ". (" << a << ", " << b << ", " << c << ")";                    // 检查是否为互质(最大公约数为1)                    int x = a, y = b, z = c;                    while(y != 0) { int temp = y; y = x % y; x = temp; }                    while(z != 0) { int temp = z; z = x % z; x = temp; }                    if(x == 1) cout << " [互质]";                    cout << endl;                }            }        }    }    cout << "共找到 " << count << " 组勾股数" << endl;}intmain(){    cout << "=== 勾股定理应用 ===" << endl;    // 1. 判断三角形类型    cout << "\n1. 判断三角形类型" << endl;    Triangle t;    cout << "输入三角形三边长:";    cin >> t.a >> t.b >> t.c;    t.isRight = isRightTriangle(t.a, t.b, t.c);    if(t.a + t.b > t.c && t.a + t.c > t.b && t.b + t.c > t.a) {        cout << "可以构成三角形" << endl;        if(t.isRight) {            cout << "这是直角三角形" << endl;            // 找出直角边和斜边            vector<double> sides = {t.a, t.b, t.c};            sort(sides.begin(), sides.end());            cout << "直角边:" << sides[0] << " 和 " << sides[1] << endl;            cout << "斜边:" << sides[2] << endl;            cout << "勾股定理验证:" << sides[0] << "² + " << sides[1] << "² = "                  << sides[0]*sides[0] + sides[1]*sides[1] << " = "                  << sides[2] << "²" << endl;        } else {            cout << "这不是直角三角形" << endl;        }    } else {        cout << "无法构成三角形" << endl;    }    // 2. 应用问题:测量问题    cout << "\n2. 应用:测量问题" << endl;    cout << "问题:从电线杆离地面8米处向地面拉一条10米长的缆绳,求缆绳固定点与电线杆底部的距离" << endl;    double height = 8, rope = 10;    double distance = sqrt(pow(rope, 2) - pow(height, 2));    cout << "缆绳固定点与电线杆底部的距离:" << distance << " 米" << endl;    // 3. 寻找勾股数    cout << "\n3. 寻找勾股数" << endl;    int limit;    cout << "输入上限:";    cin >> limit;    findPythagoreanTriples(limit);    // 4. 勾股定理逆定理验证    cout << "\n4. 勾股定理逆定理验证" << endl;    cout << "输入三个正整数,判断它们是否能构成直角三角形:";    int x, y, z;    cin >> x >> y >> z;    if(isRightTriangle(x, y, z)) {        cout << "可以构成直角三角形" << endl;    } else {        cout << "不能构成直角三角形" << endl;    }    return 0;}

课后练习2

  1. 编写程序,输入直角三角形的两条边,计算第三条边

  2. 编写程序,生成所有满足a+b+c=100的直角三角形三边长

  3. 编写程序,验证勾股定理的多种证明方法(如赵爽弦图)

第三单元:平行四边形(4课时)

数学知识点

  1. 平行四边形的性质

  2. 平行四边形的判定

  3. 矩形、菱形、正方形的性质和判定

  4. 梯形和等腰梯形的性质

  5. 中位线定理

C++知识点

  • 结构体和类的使用

  • 函数重载

  • 向量的基本概念

  • 几何计算

编程实践

// 四边形性质判断与计算#include<iostream>#include<cmath>#include<iomanip>#include<vector>#include<algorithm>using namespace std;// 定义点结构体struct Point {    double x, y;};// 定义四边形类class Quadrilateral {private:    Point A, B, C, D;public:    Quadrilateral(Point a, Point b, Point c, Point d) : A(a), B(b), C(c), D(d) {}    // 计算两点间距离    doubledistance(Point p1, Point p2){        return sqrt(pow(p1.x - p2.x, 2) + pow(p1.y - p2.y, 2));    }    // 计算向量    pair<doubledoublevector2D(Point from, Point to){        return make_pair(to.x - from.x, to.y - from.y);    }    // 计算斜率    doubleslope(Point p1, Point p2){        if(fabs(p1.x - p2.x) < 1e-6return INFINITY;        return (p2.y - p1.y) / (p2.x - p1.x);    }    // 判断两条线是否平行(考虑浮点误差)    boolisParallel(pair<doubledouble> v1, pair<doubledouble> v2){        // 向量平行:v1 = k * v2        if(fabs(v2.first) < 1e-6 && fabs(v2.second) < 1e-6return false;        if(fabs(v2.first) > 1e-6) {            double k = v1.first / v2.first;            return fabs(v1.second - k * v2.second) < 1e-6;        } else {            double k = v1.second / v2.second;            return fabs(v1.first - k * v2.first) < 1e-6;        }    }    // 判断是否为平行四边形    boolisParallelogram(){        pair<doubledouble> AB = vector2D(A, B);        pair<doubledouble> BC = vector2D(B, C);        pair<doubledouble> CD = vector2D(C, D);        pair<doubledouble> DA = vector2D(D, A);        // 对边平行        return isParallel(AB, CD) && isParallel(BC, DA);    }    // 判断是否为矩形    boolisRectangle(){        if(!isParallelogram()) return false;        // 检查是否有直角        pair<doubledouble> AB = vector2D(A, B);        pair<doubledouble> BC = vector2D(B, C);        // 点积为0表示垂直        double dotProduct = AB.first * BC.first + AB.second * BC.second;        return fabs(dotProduct) < 1e-6;    }    // 判断是否为菱形    boolisRhombus(){        if(!isParallelogram()) return false;        // 检查四条边是否相等        double AB = distance(A, B);        double BC = distance(B, C);        double CD = distance(C, D);        double DA = distance(D, A);        return fabs(AB - BC) < 1e-6 && fabs(BC - CD) < 1e-6 && fabs(CD - DA) < 1e-6;    }    // 判断是否为正方形    boolisSquare(){        return isRectangle() && isRhombus();    }    // 计算周长    doubleperimeter(){        return distance(A, B) + distance(B, C) + distance(C, D) + distance(D, A);    }    // 计算面积(使用鞋带公式)    doublearea(){        return fabs(            A.x*B.y + B.x*C.y + C.x*D.y + D.x*A.y -            A.y*B.x - B.y*C.x - C.y*D.x - D.y*A.x        ) / 2.0;    }    // 显示四边形信息    voiddisplay(){        cout << fixed << setprecision(2);        cout << "四边形顶点坐标:" << endl;        cout << "A(" << A.x << ", " << A.y << ")" << endl;        cout << "B(" << B.x << ", " << B.y << ")" << endl;        cout << "C(" << C.x << ", " << C.y << ")" << endl;        cout << "D(" << D.x << ", " << D.y << ")" << endl;        cout << "\n四边形性质:" << endl;        if(isParallelogram()) {            cout << "- 是平行四边形" << endl;            if(isRectangle()) cout << "- 是矩形" << endl;            if(isRhombus()) cout << "- 是菱形" << endl;            if(isSquare()) cout << "- 是正方形" << endl;        } else {            cout << "- 不是平行四边形" << endl;        }        cout << "\n几何属性:" << endl;        cout << "周长:" << perimeter() << endl;        cout << "面积:" << area() << endl;    }};intmain(){    cout << "=== 四边形性质判断与计算 ===" << endl;    // 示例1:平行四边形    cout << "\n示例1:平行四边形" << endl;    {        Point A = {00};        Point B = {40};        Point C = {53};        Point D = {13};        Quadrilateral q1(A, B, C, D);        q1.display();    }    // 示例2:矩形    cout << "\n示例2:矩形" << endl;    {        Point A = {00};        Point B = {40};        Point C = {43};        Point D = {03};        Quadrilateral q2(A, B, C, D);        q2.display();    }    // 示例3:正方形    cout << "\n示例3:正方形" << endl;    {        Point A = {00};        Point B = {30};        Point C = {33};        Point D = {03};        Quadrilateral q3(A, B, C, D);        q3.display();    }    // 用户输入四边形    cout << "\n请输入四边形四个顶点的坐标:" << endl;    Point A, B, C, D;    cout << "A点(x y): ";    cin >> A.x >> A.y;    cout << "B点(x y): ";    cin >> B.x >> B.y;    cout << "C点(x y): ";    cin >> C.x >> C.y;    cout << "D点(x y): ";    cin >> D.x >> D.y;    Quadrilateral userQuad(A, B, C, D);    userQuad.display();    // 梯形判断    cout << "\n判断是否为梯形:" << endl;    // 检查是否有一组对边平行    pair<doubledouble> AB = userQuad.vector2D(A, B);    pair<doubledouble> CD = userQuad.vector2D(C, D);    pair<doubledouble> BC = userQuad.vector2D(B, C);    pair<doubledouble> DA = userQuad.vector2D(D, A);    if(userQuad.isParallel(AB, CD) || userQuad.isParallel(BC, DA)) {        cout << "是梯形" << endl;    } else {        cout << "不是梯形" << endl;    }    return 0;}

课后练习3

  1. 编写程序,输入平行四边形的底和高,计算面积和周长

  2. 编写程序,判断四边形是否为等腰梯形

  3. 编写程序,计算梯形的中位线长度

第四单元:一次函数(5课时)

数学知识点

  1. 函数的概念

  2. 一次函数的图像和性质

  3. 用待定系数法确定一次函数表达式

  4. 一次函数与方程、不等式的关系

  5. 一次函数的应用

C++知识点

  • 函数的定义与调用

  • 数组和向量

  • 文件操作

  • 图形绘制(简单字符图形)

  • 算法的复杂度

编程实践

// 一次函数分析工具#include<iostream>#include<cmath>#include<iomanip>#include<vector>#include<fstream>#include<algorithm>using namespace std;// 一次函数类class LinearFunction {private:    double k;  // 斜率    double b;  // 截距public:    LinearFunction(double k_val = 1double b_val = 0) : k(k_val), b(b_val) {}    // 计算函数值    doublevalue(double x){        return k * x + b;    }    // 求零点(与x轴交点)    doublezero(){        if(k == 0) {            if(b == 0return 0;  // 无穷多解            return NAN;  // 无解        }        return -b / k;    }    // 求与y轴交点    doubleyIntercept(){        return b;    }    // 判断增减性    string monotonicity(){        if(k > 0return "递增";        if(k < 0return "递减";        return "常数";    }    // 求两条直线的交点    pair<doubledoubleintersection(LinearFunction other){        if(fabs(k - other.k) < 1e-6) {            // 平行或重合            if(fabs(b - other.b) < 1e-6) {                return make_pair(NAN, NAN);  // 重合,无穷多交点            }            return make_pair(INFINITY, INFINITY);  // 平行,无交点        }        double x = (other.b - b) / (k - other.k);        double y = value(x);        return make_pair(x, y);    }    // 显示函数信息    voiddisplay(){        cout << "函数:y = ";        if(k != 1 && k != -1) {            if(k != 0) cout << k;        } else if(k == -1) {            cout << "-";        }        if(k != 0) cout << "x";        if(b > 0) {            cout << " + " << b;        } else if(b < 0) {            cout << " - " << -b;        } else if(k == 0) {            cout << b;        }        cout << endl;        cout << "斜率k = " << k << endl;        cout << "截距b = " << b << endl;        cout << "与y轴交点:(0, " << yIntercept() << ")" << endl;        double zeroPoint = zero();        if(!isnan(zeroPoint)) {            cout << "与x轴交点:(" << zeroPoint << ", 0)" << endl;        } else {            cout << "与x轴无交点" << endl;        }        cout << "增减性:" << monotonicity() << endl;    }    // 绘制函数图像(简单字符图形)    voidplot(int width = 50int height = 25){        vector<vector<char>> grid(height, vector<char>(width, ' '));        // 绘制坐标轴        int midX = width / 2;        int midY = height / 2;        // x轴        for(int x = 0; x < width; x++) {            grid[midY][x] = '-';        }        // y轴        for(int y = 0; y < height; y++) {            grid[y][midX] = '|';        }        // 原点        grid[midY][midX] = '+';        // 绘制函数图像        double scaleX = 10.0 / (width/2);  // x轴的缩放比例        double scaleY = 10.0 / (height/2); // y轴的缩放比例        for(int i = 0; i < width; i++) {            double x = (i - midX) * scaleX;            double y = value(x);            int y_pixel = midY - int(y / scaleY + 0.5);            if(y_pixel >= 0 && y_pixel < height) {                grid[y_pixel][i] = '*';            }        }        // 输出图像        cout << "\n函数图像(简易版):" << endl;        for(int y = 0; y < height; y++) {            for(int x = 0; x < width; x++) {                cout << grid[y][x];            }            cout << endl;        }    }    // 求解不等式 kx + b > 0    voidsolveInequality(){        cout << "\n解不等式 " << k << "x ";        if(b >= 0) cout << "+ " << b;        else cout << "- " << -b;        cout << " > 0" << endl;        double zeroPoint = zero();        if(isnan(zeroPoint)) {            if(b > 0) cout << "解集为全体实数" << endl;            else cout << "无解" << endl;        } else {            if(k > 0) {                cout << "x > " << zeroPoint << endl;            } else if(k < 0) {                cout << "x < " << zeroPoint << endl;            }        }    }};// 通过两点确定一次函数LinearFunction linearFunctionFromPoints(double x1, double y1, double x2, double y2){    if(fabs(x1 - x2) < 1e-6) {        cout << "两点x坐标相同,不是函数" << endl;        return LinearFunction(NAN, NAN);    }    double k = (y2 - y1) / (x2 - x1);    double b = y1 - k * x1;    return LinearFunction(k, b);}// 最小二乘法拟合一次函数LinearFunction linearRegression(const vector<double>& x, const vector<double>& y){    int n = x.size();    double sumX = 0, sumY = 0, sumXY = 0, sumX2 = 0;    for(int i = 0; i < n; i++) {        sumX += x[i];        sumY += y[i];        sumXY += x[i] * y[i];        sumX2 += x[i] * x[i];    }    double k = (n * sumXY - sumX * sumY) / (n * sumX2 - sumX * sumX);    double b = (sumY - k * sumX) / n;    return LinearFunction(k, b);}intmain(){    cout << "=== 一次函数分析工具 ===" << endl;    // 1. 创建一次函数    cout << "\n1. 创建一次函数" << endl;    double k, b;    cout << "输入斜率k和截距b:";    cin >> k >> b;    LinearFunction f1(k, b);    f1.display();    // 2. 计算函数值    cout << "\n2. 计算函数值" << endl;    double x;    cout << "输入x值:";    cin >> x;    cout << "f(" << x << ") = " << f1.value(x) << endl;    // 3. 绘制函数图像    cout << "\n3. 绘制函数图像" << endl;    f1.plot();    // 4. 解不等式    f1.solveInequality();    // 5. 两点确定一次函数    cout << "\n5. 通过两点确定一次函数" << endl;    double x1, y1, x2, y2;    cout << "输入点1坐标(x y):";    cin >> x1 >> y1;    cout << "输入点2坐标(x y):";    cin >> x2 >> y2;    LinearFunction f2 = linearFunctionFromPoints(x1, y1, x2, y2);    f2.display();    // 6. 求两条直线的交点    cout << "\n6. 求两条直线的交点" << endl;    pair<doubledouble> intersection = f1.intersection(f2);    if(isinf(intersection.first)) {        cout << "两条直线平行,无交点" << endl;    } else if(isnan(intersection.first)) {        cout << "两条直线重合,有无穷多交点" << endl;    } else {        cout << "交点坐标:(" << intersection.first << ", " << intersection.second << ")" << endl;    }    // 7. 线性回归    cout << "\n7. 线性回归(最小二乘法)" << endl;    vector<double> xs = {12345};    vector<double> ys = {24545};    cout << "样本数据:" << endl;    for(int i = 0; i < xs.size(); i++) {        cout << "(" << xs[i] << ", " << ys[i] << ")" << endl;    }    LinearFunction regression = linearRegression(xs, ys);    cout << "\n回归直线:";    regression.display();    // 8. 应用问题    cout << "\n8. 应用问题:手机套餐选择" << endl;    cout << "套餐A:月租30元,通话0.2元/分钟" << endl;    cout << "套餐B:月租50元,通话0.1元/分钟" << endl;    LinearFunction planA(0.230);  // y = 0.2x + 30    LinearFunction planB(0.150);  // y = 0.1x + 50    // 计算平衡点    pair<doubledouble> balance = planA.intersection(planB);    double balanceMinutes = balance.first;    double balanceCost = balance.second;    cout << "平衡点:" << balanceMinutes << "分钟,费用" << balanceCost << "元" << endl;    cout << "建议:" << endl;    cout << "- 如果每月通话少于" << balanceMinutes << "分钟,选择套餐A更划算" << endl;    cout << "- 如果每月通话多于" << balanceMinutes << "分钟,选择套餐B更划算" << endl;    return 0;}

课后练习4

  1. 编写程序,输入一次函数和x的范围,输出函数值表

  2. 编写程序,实现一次函数图像的平移和伸缩变换

  3. 编写程序,解决一次函数与二元一次方程组的关系问题

第五单元:数据的分析(3课时)

数学知识点

  1. 平均数、加权平均数

  2. 中位数、众数

  3. 方差、标准差

  4. 数据分析的应用

C++知识点

  • 数组和向量的高级操作

  • 排序算法

  • 统计计算

  • 文件操作

  • 数据可视化

编程实践

// 数据分析系统#include<iostream>#include<fstream>#include<vector>#include<algorithm>#include<cmath>#include<iomanip>#include<map>#include<limits>using namespace std;class DataAnalyzer {private:    vector<double> data;    string dataSource;public:    DataAnalyzer() {}    // 从文件加载数据    boolloadFromFile(const string& filename){        ifstream file(filename);        if(!file.is_open()) {            cout << "无法打开文件:" << filename << endl;            return false;        }        data.clear();        double value;        while(file >> value) {            data.push_back(value);        }        file.close();        dataSource = filename;        return true;    }    // 手动输入数据    voidinputData(){        data.clear();        int n;        cout << "输入数据个数:";        cin >> n;        cout << "输入" << n << "个数据:" << endl;        for(int i = 0; i < n; i++) {            double value;            cin >> value;            data.push_back(value);        }        dataSource = "手动输入";    }    // 生成随机数据    voidgenerateRandomData(int count, double minVal, double maxVal){        data.clear();        srand(time(0));        for(int i = 0; i < count; i++) {            double value = minVal + (maxVal - minVal) * (rand() / double(RAND_MAX));            data.push_back(value);        }        dataSource = "随机生成";    }    // 计算基本统计量    voidcalculateBasicStats(){        if(data.empty()) {            cout << "没有数据" << endl;            return;        }        sort(data.begin(), data.end());        double sum = 0;        double minVal = data[0];        double maxVal = data.back();        for(double val : data) {            sum += val;        }        double mean = sum / data.size();        double median;        if(data.size() % 2 == 1) {            median = data[data.size() / 2];        } else {            median = (data[data.size() / 2 - 1] + data[data.size() / 2]) / 2.0;        }        // 众数        map<doubleint> freq;        for(double val : data) {            freq[val]++;        }        double mode = data[0];        int maxFreq = 0;        for(auto& pair : freq) {            if(pair.second > maxFreq) {                maxFreq = pair.second;                mode = pair.first;            }        }        // 方差和标准差        double variance = 0;        for(double val : data) {            variance += pow(val - mean, 2);        }        variance /= data.size();        double stddev = sqrt(variance);        // 四分位数        double q1, q3;        int n = data.size();        if(n % 2 == 0) {            q1 = data[n/4];            q3 = data[3*n/4];        } else {            q1 = data[(n-1)/4];            q3 = data[3*(n-1)/4];        }        double IQR = q3 - q1;  // 四分位距        // 输出结果        cout << fixed << setprecision(3);        cout << "=== 基本统计量 ===" << endl;        cout << "数据来源:" << dataSource << endl;        cout << "数据个数:" << data.size() << endl;        cout << "最小值:  " << minVal << endl;        cout << "最大值:  " << maxVal << endl;        cout << "极差:    " << maxVal - minVal << endl;        cout << "平均数:  " << mean << endl;        cout << "中位数:  " << median << endl;        cout << "众数:    " << mode << "(出现" << maxFreq << "次)" << endl;        cout << "方差:    " << variance << endl;        cout << "标准差:  " << stddev << endl;        cout << "第一四分位数(Q1):" << q1 << endl;        cout << "第三四分位数(Q3):" << q3 << endl;        cout << "四分位距(IQR):  " << IQR << endl;        // 异常值检测        double lowerBound = q1 - 1.5 * IQR;        double upperBound = q3 + 1.5 * IQR;        vector<double> outliers;        for(double val : data) {            if(val < lowerBound || val > upperBound) {                outliers.push_back(val);            }        }        if(!outliers.empty()) {            cout << "\n异常值检测:" << endl;            cout << "正常值范围:[" << lowerBound << ", " << upperBound << "]" << endl;            cout << "发现" << outliers.size() << "个异常值:" << endl;            for(double val : outliers) {                cout << val << " ";            }            cout << endl;        }    }    // 计算加权平均数    doubleweightedMean(const vector<double>& weights){        if(data.size() != weights.size()) {            cout << "数据个数与权重个数不匹配" << endl;            return NAN;        }        double weightedSum = 0;        double weightSum = 0;        for(int i = 0; i < data.size(); i++) {            weightedSum += data[i] * weights[i];            weightSum += weights[i];        }        return weightedSum / weightSum;    }    // 绘制直方图    voiddrawHistogram(int bins = 10){        if(data.empty()) return;        double minVal = *min_element(data.begin(), data.end());        double maxVal = *max_element(data.begin(), data.end());        double range = maxVal - minVal;        double binWidth = range / bins;        vector<intfreq(bins, 0);        for(double val : data) {            int binIndex = min(int((val - minVal) / binWidth), bins - 1);            freq[binIndex]++;        }        int maxFreq = *max_element(freq.begin(), freq.end());        int maxStars = 50;        cout << "\n=== 直方图 ===" << endl;        for(int i = 0; i < bins; i++) {            double lower = minVal + i * binWidth;            double upper = lower + binWidth;            cout << "[" << setw(6) << lower << ", " << setw(6) << upper << "): ";            int stars = (maxFreq > 0) ? (freq[i] * maxStars / maxFreq) : 0;            for(int j = 0; j < stars; j++) {                cout << "*";            }            cout << " (" << freq[i] << ")" << endl;        }    }    // 绘制箱线图(字符版)    voiddrawBoxPlot(){        if(data.empty()) return;        sort(data.begin(), data.end());        int n = data.size();        double q1 = data[n/4];        double median = (n % 2 == 1) ? data[n/2] : (data[n/2-1] + data[n/2]) / 2;        double q3 = data[3*n/4];        double IQR = q3 - q1;        double lowerBound = q1 - 1.5 * IQR;        double upperBound = q3 + 1.5 * IQR;        // 找出正常值范围内的最小值和最大值        double lowerWhisker = data.back();        double upperWhisker = data[0];        for(double val : data) {            if(val >= lowerBound && val <= upperBound) {                lowerWhisker = min(lowerWhisker, val);                upperWhisker = max(upperWhisker, val);            }        }        // 创建箱线图        const int width = 60;        vector<charline(width, ' ');        // 刻度        double minVal = data[0];        double maxVal = data.back();        double scale = (maxVal - minVal) / (width - 1);        auto valueToPosition = [&](double value) -> int {            return int((value - minVal) / scale);        };        // 绘制箱线图        line[valueToPosition(minVal)] = '|';        line[valueToPosition(maxVal)] = '|';        int posLowerWhisker = valueToPosition(lowerWhisker);        int posQ1 = valueToPosition(q1);        int posMedian = valueToPosition(median);        int posQ3 = valueToPosition(q3);        int posUpperWhisker = valueToPosition(upperWhisker);        // 绘制箱体        for(int i = posQ1; i <= posQ3; i++) {            line[i] = '=';        }        // 绘制中位数线        line[posMedian] = '|';        // 绘制须线        for(int i = posLowerWhisker; i <= posQ1; i++) {            line[i] = '-';        }        for(int i = posQ3; i <= posUpperWhisker; i++) {            line[i] = '-';        }        // 标记异常值        for(double val : data) {            if(val < lowerBound || val > upperBound) {                int pos = valueToPosition(val);                if(pos >= 0 && pos < width) {                    line[pos] = '*';                }            }        }        // 输出箱线图        cout << "\n=== 箱线图 ===" << endl;        for(int i = 0; i < width; i++) {            cout << line[i];        }        cout << endl;        // 输出刻度        cout << setw(valueToPosition(minVal)) << minVal;        cout << setw(valueToPosition(median) - valueToPosition(minVal)) << median;        cout << setw(valueToPosition(maxVal) - valueToPosition(median)) << maxVal << endl;        cout << "\n图例:- 须线,= 箱体,| 中位数,* 异常值" << endl;    }    // 保存分析结果到文件    voidsaveResults(const string& filename){        ofstream file(filename);        if(!file.is_open()) {            cout << "无法创建文件:" << filename << endl;            return;        }        file << fixed << setprecision(3);        file << "数据分析报告" << endl;        file << "数据来源:" << dataSource << endl;        file << "数据个数:" << data.size() << endl;        // 保存数据        file << "\n原始数据:" << endl;        for(double val : data) {            file << val << " ";        }        file << endl;        // 计算并保存统计量        sort(data.begin(), data.end());        double sum = 0;        for(double val : data) sum += val;        double mean = sum / data.size();        double variance = 0;        for(double val : data) {            variance += pow(val - mean, 2);        }        variance /= data.size();        file << "\n统计量:" << endl;        file << "最小值:" << data[0] << endl;        file << "最大值:" << data.back() << endl;        file << "平均数:" << mean << endl;        file << "方差:" << variance << endl;        file << "标准差:" << sqrt(variance) << endl;        file.close();        cout << "分析结果已保存到:" << filename << endl;    }};intmain(){    DataAnalyzer analyzer;    int choice;    do {        cout << "\n=== 数据分析系统 ===" << endl;        cout << "1. 从文件加载数据" << endl;        cout << "2. 手动输入数据" << endl;        cout << "3. 生成随机数据" << endl;        cout << "4. 计算基本统计量" << endl;        cout << "5. 绘制直方图" << endl;        cout << "6. 绘制箱线图" << endl;        cout << "7. 保存分析结果" << endl;        cout << "8. 加权平均数计算" << endl;        cout << "0. 退出" << endl;        cout << "请选择:";        cin >> choice;        switch(choice) {            case 1: {                string filename;                cout << "输入文件名:";                cin >> filename;                analyzer.loadFromFile(filename);                break;            }            case 2:                analyzer.inputData();                break;            case 3: {                int count;                double minVal, maxVal;                cout << "输入数据个数:";                cin >> count;                cout << "输入最小值:";                cin >> minVal;                cout << "输入最大值:";                cin >> maxVal;                analyzer.generateRandomData(count, minVal, maxVal);                break;            }            case 4:                analyzer.calculateBasicStats();                break;            case 5:                analyzer.drawHistogram();                break;            case 6:                analyzer.drawBoxPlot();                break;            case 7: {                string filename;                cout << "输入保存文件名:";                cin >> filename;                analyzer.saveResults(filename);                break;            }            case 8: {                int n;                cout << "输入权重个数:";                cin >> n;                vector<doubleweights(n);                cout << "输入" << n << "个权重:" << endl;                for(int i = 0; i < n; i++) {                    cin >> weights[i];                }                double result = analyzer.weightedMean(weights);                if(!isnan(result)) {                    cout << "加权平均数:" << result << endl;                }                break;            }            case 0:                cout << "退出系统" << endl;                break;            default:                cout << "无效选择" << endl;        }    } while(choice != 0);    return 0;}

课后练习5

  1. 编写程序,计算班级学生成绩的方差和标准差,并分析成绩分布

  2. 编写程序,实现数据的归一化处理(将数据缩放到0-1范围)

  3. 编写程序,比较两组数据的差异(如t检验的简化版)

三、综合复习与期末项目

综合复习要点:

  1. 代数部分:二次根式的运算、勾股定理的应用

  2. 几何部分:四边形的性质与判定、空间想象能力

  3. 函数部分:一次函数的性质与应用、函数图像的绘制

  4. 统计部分:数据的收集与分析、统计量的计算

  5. C++编程核心:类与对象、算法设计、文件操作、数据可视化

期末项目:学校成绩管理系统增强版

项目要求

  1. 使用面向对象编程,设计学生、班级、课程等类

  2. 从文件读取学生信息和各科成绩

  3. 实现以下功能:

    • 学生成绩的录入、修改、查询

    • 各科成绩的统计分析(平均分、方差、标准差、分数段分布)

    • 成绩排名和进步分析

    • 成绩预测(基于历史数据的简单预测)

    • 生成各类图表(直方图、折线图、箱线图)

  4. 数据可视化:使用字符或简单图形展示分析结果

  5. 数据持久化:将分析结果保存到文件

四、资源准备:
  1. 软件:Code::Blocks / Dev-C++ / VS Code

  2. 教材:人教版六年级下册数学教材

  3. 参考资料:C++入门教程、数学与编程结合的案例集

  4. 在线资源:在线编程练习平台、数学可视化工具

推荐阅读

编程与数学||C++编程与七年级下册数学融合学习纲要

编程与数学||C++编程与小学数学融合学习纲要

开卷有益,原创不易,且行且努力。公众号每一篇文章都经过我们的精选和编写、用心去完成的,大家转载时请注明来源!

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-02-07 23:42:21 HTTP/2.0 GET : https://f.mffb.com.cn/a/467444.html
  2. 运行时间 : 0.188687s [ 吞吐率:5.30req/s ] 内存消耗:4,559.23kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=01c928bd5a84c32ccea28930ddce8a97
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.001132s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.001562s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000731s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.001054s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.001494s ]
  6. SELECT * FROM `set` [ RunTime:0.000547s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.001489s ]
  8. SELECT * FROM `article` WHERE `id` = 467444 LIMIT 1 [ RunTime:0.004395s ]
  9. UPDATE `article` SET `lasttime` = 1770478941 WHERE `id` = 467444 [ RunTime:0.005109s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 65 LIMIT 1 [ RunTime:0.025173s ]
  11. SELECT * FROM `article` WHERE `id` < 467444 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.015427s ]
  12. SELECT * FROM `article` WHERE `id` > 467444 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.028389s ]
  13. SELECT * FROM `article` WHERE `id` < 467444 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.008635s ]
  14. SELECT * FROM `article` WHERE `id` < 467444 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.004581s ]
  15. SELECT * FROM `article` WHERE `id` < 467444 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.002571s ]
0.192538s