当前位置: 首页 > news >正文

【程序设计与算法(三)】测验和作业题部分答案汇总(面向对象篇)

题目来源:程序设计与算法(三)测验和作业题汇总

文章目录

    • 001:简单的swap
    • 002:难一点的swap
    • 003:好怪异的返回值
    • 004:神秘的数组初始化
    • 005:编程填空:学生信息处理程序
    • 006:奇怪的类复制
    • 007:返回什么才好呢
    • 008:超简单的复数类
    • 009:哪来的输出
    • 010:返回什么才好呢
    • 011:Big & Base 封闭类问题
    • 012:这个指针哪来的
    • 013:魔兽世界之一:备战
    • 014:MyString
    • 015:看上去好坑的运算符重载
    • 016:惊呆!Point竟然能这样输入输出
    • 017:二维数组类
    • 018:别叫,这个大整数已经很简化了!
    • 019:全面的MyString
    • 020:继承自string的MyString
    • 021:魔兽世界之二:装备
    • 022:看上去像多态
    • 023:Fun和Do
    • 024:这是什么鬼delete
    • 025:怎么又是Fun和Do
    • 026:编程填空:统计动物数量

001:简单的swap

#include <iostream>
using namespace std;class A
{public:int x;int getX() { return x; }	
};void swap(A &a, A &b)
{int  tmp = a.x;a.x = b.x;b.x = tmp;
}int main()
{A a,b;a.x = 3;b.x = 5;swap(a,b);cout << a.getX() << "," << b.getX();return 0;
}

输出:

5,3

002:难一点的swap

#include <iostream>
using namespace std;void swap(int *&a, int *&b)
{int * tmp = a;a = b;b = tmp;
}int main()
{int a = 3,b = 5;int * pa = & a;int * pb = & b;swap(pa,pb);cout << *pa << "," << * pb;return 0;
}

输出:

5,3

003:好怪异的返回值

#include <iostream>
using namespace std;// 当函数引用时,函数可用作左值
// 函数的返回类型决定函数调用是否是左值,当调用一个返回引用的函数得到左值,其他返回类型得到右值
int &getElement (int * a, int i)
{return a[i];	// 返回对a[i]的引用 
}int main()
{int a[] = {1,2,3};getElement(a,1) = 10;cout << a[1] ;return 0;
}

输出:

10

004:神秘的数组初始化

#include <iostream>
using namespace std;int main()
{int * a[] = {NULL, NULL, new int, new int[6]};*a[2] = 123;a[3][5] = 456;if(! a[0] ) {cout << * a[2] << "," << a[3][5];}return 0;
}

输出:

123,456

005:编程填空:学生信息处理程序

描述:实现一个学生信息处理程序,计算一个学生的四年平均成绩。

要求实现一个代表学生的类,并且类中所有成员变量都是【私有的】。

补充下列程序中的 Student 类以实现上述功能。

#include <iostream>
#include <string>
#include <cstdio>
#include <cstring>
#include <sstream>
#include <cstdlib>
using namespace std;class Student {
// 在此处补充你的代码
};int main() {Student student;        // 定义类的对象student.input();        // 输入数据student.calculate();    // 计算平均成绩student.output();       // 输出数据
}

输入:输入数据为一行,包括:姓名,年龄,学号,第一学年平均成绩,第二学年平均成绩,第三学年平均成绩,第四学年平均成绩。其中姓名为由字母和空格组成的字符串(输入保证姓名不超过20个字符,并且空格不会出现在字符串两端),年龄、学号和学年平均成绩均为非负整数。信息之间用逗号隔开。

Tom Hanks,18,7817,80,80,90,70

输出:输出一行数据,包括:姓名,年龄,学号,四年平均成绩。信息之间用逗号隔开。

Tom Hanks,18,7817,80

题解:

#include <iostream>
#include <string>
#include <cstdio>
#include <cstring>
#include <sstream>
#include <cstdlib>
using namespace std;class Student {private:char c;char name[20];int age;int num;int grade[5];double ave;public:void input(){cin.getline(name,20,',');cin>>age>>c>>num>>c>>grade[1]>>c>>grade[2]>>c>>grade[3]>>c>>grade[4];}void calculate(){ave=(double)(grade[1]+grade[2]+grade[3]+grade[4])/4;}void output(){cout<<name<<","<<age<<","<<num<<","<<ave;}};int main() {Student student;        // 定义类的对象student.input();        // 输入数据student.calculate();    // 计算平均成绩student.output();       // 输出数据
}

006:奇怪的类复制

只有在初始化对象的时候,才会调用构造函数或复制构造函数!

#include <iostream>
using namespace std;class Sample {
public:int v;
// 在此处补充你的代码Sample (int x = 0): v(x) {} //类型隐式转换构造函数Sample (const Sample &o){v = o.v + 2; }
};void PrintAndDouble(Sample o)  // 形参作为实参时,会调用复制构造函数 
{cout << o.v;cout << endl;
}int main()
{Sample a(5);Sample b = a;	// 调用复制构造函数,是初始化语句 PrintAndDouble(b); // 调用复制构造函数Sample c = 20;  // 20转换为临时对象,调用类型转换构造函数,是初始化语句 PrintAndDouble(c); // 调用复制构造函数Sample d;d = a;  // 不会调用复制构造函数,因为d已经初始化定义过了,是赋值语句 cout << d.v;return 0;
}

输出:

9
22
5

007:返回什么才好呢

#include <iostream>
using namespace std;class A {
public:int val;A(int v = 123): val(v) {}  // 类型转换构造函数 A &GetObj(){return *this;}
};int main()
{int m,n;A a;cout << a.val << endl;while(cin >> m >> n) {a.GetObj() = m;		// m转换为临时对象 cout << a.val << endl;a.GetObj() = A(n);  cout << a.val<< endl;}return 0;
}

输入:多组数据,每组一行,是整数 m 和 n

2 3
4 5

输出:先输出一行:123,然后,对每组数据,输出两行,第一行是m,第二行是n

123
2
3
4
5 

008:超简单的复数类

#include <iostream>
#include <cstring>
#include <cstdlib>
using namespace std;
class Complex {
private:double r,i;
public:void Print() {cout << r << "+" << i << "i" << endl;}Complex(char *s=" "){r=s[0]-'0';i=s[2]-'0';}
};
int main() {Complex a;a = "3+4i"; a.Print();a = "5+6i"; a.Print();return 0;
}

输出:

3+4i
5+6i

009:哪来的输出

#include <iostream>
using namespace std;class A {public:int i;A(int x) { i = x; }
// 在此处补充你的代码~A(){cout << i << endl;}
};int main()
{A a(1);A * pa = new A(2);delete pa;return 0;
}

输出:

2
1

010:返回什么才好呢

(与007相同,略)

011:Big & Base 封闭类问题

#include <iostream>
#include <string>
using namespace std;class Base {
public:int k;Base(int n):k(n) { }
};class Big
{
public:int v;Base b;
// 在此处补充你的代码Big(int n):v(n), b(v) { }
};int main()
{int n;while(cin >>n) {Big a1(n);Big a2 = a1;cout << a1.v << "," << a1.b.k << endl;cout << a2.v << "," << a2.b.k << endl;}
}

输入:多组数据,每组一行,是一个整数

3
4

输出:对每组数据,输出两行,每行把输入的整数打印两遍

3,3
3,3
4,4
4,4	

012:这个指针哪来的

#include <iostream>
using namespace std;struct A
{int v;A(int vv):v(vv) { }
// 在此处补充你的代码const A *getPointer() const{ // 常量成员函数不能修改成员变量,返回值既可以是常量,也可以是变量 return this;}
};int main()
{const A a(10);const A * p = a.getPointer(); // 常量对象只能调用常量成员函数 cout << p->v << endl;return 0;
}

输出:

10

013:魔兽世界之一:备战

见:【POJ C++题目】魔兽世界之一:备战

014:MyString

#include <iostream>
#include <string>
#include <cstring>
using namespace std;class MyString {char * p;
public:MyString(const char * s) {if(s) {p = new char[strlen(s) + 1];strcpy(p, s);}elsep = NULL;}~MyString() { if(p) delete [] p; }// 在此处补充你的代码// 深拷贝 void Copy (const char * s){if(s) {p = new char[strlen(s) + 1];strcpy(p, s);}elsep = NULL;}// 深拷贝MyString (const MyString &o){if(o.p) {p = new char[strlen(o.p) + 1];strcpy(p, o.p);}elsep = NULL;}// 深拷贝 MyString &operator = (const MyString &o){if (p == o.p)return *this;if (p)delete [] p;if(o.p) {p = new char[strlen(o.p) + 1];strcpy(p, o.p);}elsep = NULL;return *this;}// 重载输出流 friend ostream & operator << (ostream &out, const MyString &o){out << o.p;return out;}
};int main()
{char w1[200], w2[100];while(cin >> w1 >> w2) {MyString s1(w1), s2 = s1; // 需要实现深拷贝 MyString s3(NULL);s3.Copy(w1);cout << s1 << "," << s2 << "," << s3 << endl;s2 = w2;s3 = s2;s1 = s3;cout << s1 << "," << s2 << "," << s3 << endl;}
}

输入:多组数据,每组一行,是两个不带空格的字符串

abc def
123 456

输出:对每组数据,先输出一行,打印输入中的第一个字符串三次,然后再输出一行,打印输入中的第二个字符串三次

abc,abc,abc
def,def,def
123,123,123
456,456,456

015:看上去好坑的运算符重载

#include <iostream> 
using namespace std;class MyInt 
{ int nVal; public: MyInt(int n) { nVal = n ;}
// 在此处补充你的代码	MyInt &operator - (int n){	// 运算符重载为成员函数时,参数个数要比运算符目数少1 this->nVal -= n;return *this;}operator int (){	// 重载类型强制转换运算符 return this->nVal;}
}; int Inc(int n) {return n + 1;
}int main () { int n;while(cin >> n) {MyInt objInt(n); objInt - 2 - 1 - 3; cout << Inc(objInt);cout << ","; objInt - 2 - 1; cout << Inc(objInt) << endl;}return 0;
}

输入:多组数据,每组一行,整数n

20
30

输出:对每组数据,输出一行,包括两个整数, n-5和n-8

15,12
25,22

016:惊呆!Point竟然能这样输入输出

#include <iostream> 
using namespace std;class Point { private: int x; int y; public: Point() { };
// 在此处补充你的代码friend istream &operator >> (istream &in, Point &p){in >> p.x >> p.y;return in;}friend ostream &operator << (ostream &out, const Point &p){out << p.x << "," << p.y;return out;}
}; int main() 
{ Point p;while(cin >> p) {cout << p << endl;}return 0;
}

输入:多组数据,每组两个整数

2 3
4 5

输出:对每组数据,输出一行,就是输入的两个整数

2,3
4,5

017:二维数组类

#include <iostream>
#include <cstring>
using namespace std;class Array2 {
// 在此处补充你的代码private:int row;int col;int data[10][10];public:Array2 (int r = 0, int c = 0): row(r), col(c) {}// 应付 a[i][j] int *operator [] (const int i){return this->data[i];}// 应付 a(i, j) int operator () (int i, int j){return this->data[i][j];}// 应付 b = a Array2 &operator = (Array2 &x){this->row = x.row;this->col = x.col;for(int i = 0; i < x.row; i++)for(int j = 0; j < x.col; j++)this->data[i][j] = x.data[i][j];return *this;}
};int main() {Array2 a(3,4);int i, j;for(  i = 0; i < 3; ++i )for(  j = 0; j < 4; j ++ )a[i][j] = i * 4 + j;for(  i = 0;i < 3; ++i ) {for(  j = 0; j < 4; j ++ ) {cout << a(i, j) << ",";}cout << endl;}cout << "next" << endl;Array2 b;     b = a;for(  i = 0; i < 3; ++i ) {for(  j = 0; j < 4; j ++ ) {cout << b[i][j] << ",";}cout << endl;}return 0;
}

输出:

0,1,2,3,
4,5,6,7,
8,9,10,11,
next
0,1,2,3,
4,5,6,7,
8,9,10,11,

018:别叫,这个大整数已经很简化了!

(提示:使用高精度算法)

019:全面的MyString

(略)

020:继承自string的MyString

(略)

021:魔兽世界之二:装备

见:【POJ C++题目】魔兽世界之二:装备

见:【POJ C++题目】魔兽世界之二:装备(简化)

022:看上去像多态

#include <iostream>
using namespace std;class B { private: int nBVal; public: void Print() { cout << "nBVal="<< nBVal << endl; } void Fun() {cout << "B::Fun" << endl; } B (int n) { nBVal = n;} 
};// 在此处补充你的代码
class D: public B{ private: int nDVal; public: void Print() { B::Print(); cout << "nDVal="<< nDVal << endl; } void Fun() {cout << "D::Fun" << endl; } D (int n): B(n * 3){ nDVal = n;} 
};int main() { B * pb; D * pd; D d(4); d.Fun(); pb = new B(2); pd = new D(8); pb->Fun(); pd->Fun(); pb->Print(); pd->Print(); pb = & d; pb->Fun(); pb->Print(); return 0;
}

输出:

D::Fun
B::Fun
D::Fun
nBVal=2
nBVal=24
nDVal=8
B::Fun
nBVal=12

023:Fun和Do

#include <iostream> 
using namespace std;class A { private: int nVal; public: void Fun() { cout << "A::Fun" << endl; }; void Do() { cout << "A::Do" << endl; } 
}; class B:public A { public: virtual void Do() { cout << "B::Do" << endl;} 
}; class C:public B { public: void Do( ) { cout <<"C::Do"<<endl; } void Fun() { cout << "C::Fun" << endl; } 
}; void Call(B &p) { p.Fun();	// B类没有Fun,先调用基类(A类)的同名成员函数 p.Do(); 	// 多态,调用哪个Do,取决于p引用了哪个类的对象 
} int main() { C c; Call(c); return 0;
}

输出:

A::Fun
C::Do

024:这是什么鬼delete

#include <iostream> 
using namespace std;class A 
{ public:A() { }
// 在此处补充你的代码virtual ~A() { cout << "destructor A" << endl; }
}; class B:public A { public: ~B() { cout << "destructor B" << endl; } 
}; int main() 
{ A * pa; pa = new B;  // 先调用构造函数A,再调用构造函数B delete pa;   // 先调用虚析构函数B,再调用虚析构函数A(若没有加virtual,则只会调用析构函数A) return 0;
}

输出:

destructor B
destructor A

025:怎么又是Fun和Do

#include <iostream>
using namespace std;class A {private:int nVal;public:void Fun(){ cout << "A::Fun" << endl; };virtual void Do(){ cout << "A::Do" << endl; }
};class B:public A {public:virtual void Do(){ cout << "B::Do" << endl;}
};class C:public B {public:void Do( ){ cout <<"C::Do"<<endl; }void Fun(){ cout << "C::Fun" << endl; }
};void Call(A *p) {p->Fun();  // p指向A时,A::Fun被调用;// p指向C时,由于是基类(A类)指针,Fun不是虚函数,所以A::Fun被调用  p->Do();   // p指向A时,A::Do被调用; // p指向C时,由于是基类(A类)指针,且Do是虚函数,多态,所以C::Do被调用 
}int main() {Call(new A());Call(new C());return 0;
}

输出:

A::Fun
A::Do
A::Fun
C::Do

026:编程填空:统计动物数量

描述:代码填空,使得程序能够自动统计当前各种动物的数量

#include <iostream>
using namespace std;
// 在此处补充你的代码
void print() {cout << Animal::number << " animals in the zoo, " << Dog::number << " of them are dogs, " << Cat::number << " of them are cats" << endl;
}int main() {print();Dog d1, d2;Cat c1;print();Dog* d3 = new Dog();Animal* c2 = new Cat;Cat* c3 = new Cat;print();delete c3;delete c2;delete d3;print();
}

输出:

0 animals in the zoo, 0 of them are dogs, 0 of them are cats
3 animals in the zoo, 2 of them are dogs, 1 of them are cats
6 animals in the zoo, 3 of them are dogs, 3 of them are cats
3 animals in the zoo, 2 of them are dogs, 1 of them are cats

题解:

#include <iostream>
using namespace std;
class Animal{public:static int number;Animal(){number++;}virtual ~Animal(){number--;}
};class Dog:public Animal
{public:static int number;Dog(){number++;}~Dog(){number--;}
};class Cat:public Animal
{public:static int number;Cat(){number++;}~Cat(){number--;}
};int Dog::number = 0;
int Cat::number = 0;
int Animal::number = 0;
void print() {cout << Animal::number << " animals in the zoo, " << Dog::number << " of them are dogs, " << Cat::number << " of them are cats" << endl;
}int main() {print();Dog d1, d2;Cat c1;print();Dog* d3 = new Dog();Animal* c2 = new Cat;Cat* c3 = new Cat;print();delete c3;delete c2;delete d3;print();
}

相关文章:

【程序设计与算法(三)】测验和作业题部分答案汇总(面向对象篇)

题目来源&#xff1a;程序设计与算法&#xff08;三&#xff09;测验和作业题汇总 文章目录001:简单的swap002:难一点的swap003:好怪异的返回值004:神秘的数组初始化005:编程填空&#xff1a;学生信息处理程序006:奇怪的类复制007:返回什么才好呢008:超简单的复数类009:哪来的输…...

LeetCode 349. 两个数组的交集和 692. 前K个高频单词

两个数组的交集 难度 简单 题目链接 这道题的难度不大&#xff0c;我们可以把数组里的数据存到set里面。这样就完成了排序和去重&#xff0c;然后我们再把一个set里面的数据和另外一个set数据进行比较。如果相同就插入到数组里。 代码如下&#xff1a; 但是这个算法的时间复…...

SpringCloud的五大组件功能

SpringCloud的五大组件 EurekaRibbonHystrixZuulConfig 一、Eureka 作用是实现服务治理&#xff0c;即服务注册与发现。 Eureka服务器相当于一个中介&#xff0c;负责管理、记录服务提供者的信息。服务调用者不需要自己寻找服务 &#xff0c;而是把需求告诉Eureka &#x…...

剑指 Offer II 016. 不含重复字符的最长子字符串

题目链接 剑指 Offer II 016. 不含重复字符的最长子字符串 mid 题目描述 给定一个字符串 s&#xff0c;请你找出其中不含有重复字符的 最长连续子字符串 的长度。 示例 1: 输入: s “abcabcbb” 输出: 3 解释: 因为无重复字符的最长子字符串是 “abc”&#xff0c;所以其长度…...

HBase读取流程详解

读流程从头到尾可以分为如下4个步骤&#xff1a;Client-Server读取交互逻辑&#xff0c;Server端Scan框架体系&#xff0c;过滤淘汰不符合查询条件的HFile&#xff0c;从HFile中读取待查找Key。其中Client-Server交互逻辑主要介绍HBase客户端在整个scan请求的过程中是如何与服务…...

Redis学习(一):NoSQL概述

为什么要使用Nosql 现在是大数据时代&#xff0c;过大的数据一般的数据库无法进行分析处理了。 单机MySQL的年代 90年代&#xff0c;一个基本的网站访问量一般不会太大&#xff0c;单个数据库完全足够&#xff01; 那个时候&#xff0c;更多的去使用静态网站&#xff0c;服务器…...

ESP32设备驱动-MCP23017并行IO扩展驱动

MCP23017并行IO扩展驱动 1、MCP23017介绍 MCP23017是一个用于 I2C 总线应用的 16 位通用并行 I/O 端口扩展器。 16 位 I/O 端口在功能上由两个 8 位端口(PORTA 和 PORTB)组成。 MCP23017 可配置为在 8 位或 16 位模式下工作。 其引脚排列如下: MCP23017 在 3.3v 下工作正常…...

RabbitMQ简介

0. 学习目标 能够说出什么是消息中间件能够安装RabbitMQ能够编写RabbitMQ的入门程序能够说出RabbitMQ的5种模式特征能够使用Spring整合RabbitMQ 1. 消息中间件概述 1.1. 什么是消息中间件 MQ全称为Message Queue&#xff0c;消息队列是应用程序和应用程序之间的通信方法。是…...

【项目设计】高并发内存池(五)[释放内存流程及调通]

&#x1f387;C学习历程&#xff1a;入门 博客主页&#xff1a;一起去看日落吗持续分享博主的C学习历程博主的能力有限&#xff0c;出现错误希望大家不吝赐教分享给大家一句我很喜欢的话&#xff1a; 也许你现在做的事情&#xff0c;暂时看不到成果&#xff0c;但不要忘记&…...

Git标签与版本发布

1. 什么是git标签 标签&#xff0c;就类似我们阅读时的书签&#xff0c;可以很轻易找到自己阅读到了哪里。 对于git来说&#xff0c;在使用git对项目进行版本管理的时候&#xff0c;当我们的项目开发到一定的阶段&#xff0c;需要发布一个版本。这时&#xff0c;我们就可以对…...

Python面向对象编程

文章目录1 作用域1.1 局部作用域2 类成员权限3 是否继承新式类4 多重继承5 虚拟子类6 内省【在运行时确定对象类型的能力】7 函数参数8 生成器1 作用域 1.1 局部作用域 1&#xff0c;当局部变量遮盖全局变量&#xff0c;使用globals()[变量名]来使用全局变量&#xff1b;2&am…...

【什么情况会导致 MySQL 索引失效?】

MySQL索引失效可能有多种原因&#xff0c;下面列举一些常见的情况&#xff1a; 数据库表数据量太小&#xff1a; 如果表的数据量非常小&#xff0c;则MySQL可能不会使用索引&#xff0c;因为它认为全表扫描的代价更小。 索引列上进行了函数操作&#xff1a; 如果在索引列上…...

Java核心知识点整理之小碎片--每天一点点(坚持呀)--自问自答系列版本

1.int和Integer Integer是int的包装类&#xff1b;int是基本数据类型。 Integer变量必须实例化后才能使用&#xff1b;int变量不需要。 Integer实际是对象的引用&#xff0c;当new一个Integer时&#xff0c;实际上是生成一个指针指向此对象&#xff1b;而int则是直接存储数据值…...

js中new Map()的使用方法

1.map的方法及属性Map对象存有键值对&#xff0c;其中的键可以是任何数据类型。Map对象记得键的原始插入顺序。Map对象具有表示映射大小的属性。1.1 基本的Map() 方法MethodDescriptionnew Map()创建新的 Map 对象。set()为 Map 对象中的键设置值。get()获取 Map 对象中键的值。…...

synchronized从入门到踹门

synchronized是什么synchronized是Java关键字&#xff0c;为了维护高并发是出现的原子性问题。技术是把双刃剑&#xff0c;多线程并发给我带来了前所未有的速率&#xff0c;然而在享受快速编程的过程&#xff0c;也给我们带来了原子性问题。如下&#xff1a;public class Main …...

ubuntu-8-安装nfs服务共享目录

Ubuntu最新版本(Ubuntu22.04LTS)安装nfs服务器及使用教程 ubuntu16.04挂载_如何在Ubuntu 20.04上设置NFS挂载 Ubuntu 20.04 设置时区、配置NTP同步 timesyncd 代替 ntpd 服务器 10.0.2.11 客户端 10.0.2.121 NFS简介 (1)什么是NFS NFS就是Network File System的缩写&#xf…...

算法练习(特辑)设计算法的常用思想

1、递推法 递推的思想是把一个复杂的庞大的计算过程转换为简单过程的多次重复&#xff0c;每一次推导的结果作为下一次推导的开始。 2、递归法 递归算法实际上是把问题转化成规模更小的同类子问题&#xff0c;先解决子问题&#xff0c;再通过相同的求解过程逐步解决更高层次…...

哈希->模拟实现+位图应用

致前行路上的人&#xff1a; 要努力&#xff0c;但不要着急&#xff0c;繁花锦簇&#xff0c;硕果累累都需要过程&#xff01; 目录 1. unordered系列关联式容器 1.1 unordered_map 1.1.1概念介绍&#xff1a; 1.1.2 unordered_map的接口说明 1.2unordered_set 1.3常见面试题oj…...

苹果手机想要传输数据到电脑怎么传输呢?

苹果手机想要传输数据到电脑怎么传输呢&#xff1f;尤其是传输数据到Windows系统&#xff0c;可能需要使用一些传输软件&#xff0c;那么常用的传输软件有哪些呢&#xff1f;下文将为大家推荐几款常用的苹果手机数据传输常用工具。近期苹果发布了iPhone14系列手机&#xff0c;如…...

Linux 练习四 (目录操作 + 文件操作)

文章目录1 基于文件指针的文件操作1.1 文件的创建&#xff0c;打开和关闭1.2 文件读写操作2 基于文件描述符的文件操作2.1 打开、创建和关闭文件2.2 文件读写2.3 改变文件大小2.4 文件映射2.5 文件定位2.6 获取文件信息2.7 复制文件描述符2.8 文件描述符和文件指针2.9 标准输入…...

微软PowerBI考试 PL300-选择 Power BI 模型框架【附练习数据】

微软PowerBI考试 PL300-选择 Power BI 模型框架 20 多年来&#xff0c;Microsoft 持续对企业商业智能 (BI) 进行大量投资。 Azure Analysis Services (AAS) 和 SQL Server Analysis Services (SSAS) 基于无数企业使用的成熟的 BI 数据建模技术。 同样的技术也是 Power BI 数据…...

基于服务器使用 apt 安装、配置 Nginx

&#x1f9fe; 一、查看可安装的 Nginx 版本 首先&#xff0c;你可以运行以下命令查看可用版本&#xff1a; apt-cache madison nginx-core输出示例&#xff1a; nginx-core | 1.18.0-6ubuntu14.6 | http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages ng…...

vue3 字体颜色设置的多种方式

在Vue 3中设置字体颜色可以通过多种方式实现&#xff0c;这取决于你是想在组件内部直接设置&#xff0c;还是在CSS/SCSS/LESS等样式文件中定义。以下是几种常见的方法&#xff1a; 1. 内联样式 你可以直接在模板中使用style绑定来设置字体颜色。 <template><div :s…...

鸿蒙中用HarmonyOS SDK应用服务 HarmonyOS5开发一个医院查看报告小程序

一、开发环境准备 ​​工具安装​​&#xff1a; 下载安装DevEco Studio 4.0&#xff08;支持HarmonyOS 5&#xff09;配置HarmonyOS SDK 5.0确保Node.js版本≥14 ​​项目初始化​​&#xff1a; ohpm init harmony/hospital-report-app 二、核心功能模块实现 1. 报告列表…...

学习STC51单片机31(芯片为STC89C52RCRC)OLED显示屏1

每日一言 生活的美好&#xff0c;总是藏在那些你咬牙坚持的日子里。 硬件&#xff1a;OLED 以后要用到OLED的时候找到这个文件 OLED的设备地址 SSD1306"SSD" 是品牌缩写&#xff0c;"1306" 是产品编号。 驱动 OLED 屏幕的 IIC 总线数据传输格式 示意图 …...

leetcodeSQL解题:3564. 季节性销售分析

leetcodeSQL解题&#xff1a;3564. 季节性销售分析 题目&#xff1a; 表&#xff1a;sales ---------------------- | Column Name | Type | ---------------------- | sale_id | int | | product_id | int | | sale_date | date | | quantity | int | | price | decimal | -…...

前端开发面试题总结-JavaScript篇(一)

文章目录 JavaScript高频问答一、作用域与闭包1.什么是闭包&#xff08;Closure&#xff09;&#xff1f;闭包有什么应用场景和潜在问题&#xff1f;2.解释 JavaScript 的作用域链&#xff08;Scope Chain&#xff09; 二、原型与继承3.原型链是什么&#xff1f;如何实现继承&a…...

Android Bitmap治理全解析:从加载优化到泄漏防控的全生命周期管理

引言 Bitmap&#xff08;位图&#xff09;是Android应用内存占用的“头号杀手”。一张1080P&#xff08;1920x1080&#xff09;的图片以ARGB_8888格式加载时&#xff0c;内存占用高达8MB&#xff08;192010804字节&#xff09;。据统计&#xff0c;超过60%的应用OOM崩溃与Bitm…...

docker 部署发现spring.profiles.active 问题

报错&#xff1a; org.springframework.boot.context.config.InvalidConfigDataPropertyException: Property spring.profiles.active imported from location class path resource [application-test.yml] is invalid in a profile specific resource [origin: class path re…...

Windows安装Miniconda

一、下载 https://www.anaconda.com/download/success 二、安装 三、配置镜像源 Anaconda/Miniconda pip 配置清华镜像源_anaconda配置清华源-CSDN博客 四、常用操作命令 Anaconda/Miniconda 基本操作命令_miniconda创建环境命令-CSDN博客...