OCC开发_变高箱梁全桥建模

news2024/11/13 13:21:48

概述

    上一篇文章《OCC开发_箱梁梁体建模》中详细介绍了箱梁梁体建模的过程。但是,对于实际桥梁,截面可能存在高度、腹板厚度、顶底板厚度变化,全桥的结构中心线存在平曲线和竖曲线。针对实际情况,通过一个截面拉伸来实现全桥建模显然不可能。因此,针对变高箱梁,本文新的思路来实现全桥建模。

思路

上一篇文章通过一个截面拉伸生成几何体的方式行不通,我们可以通过不同面来形成棱柱的方式实现。具体步骤如下:

  1. 生成控制数据(控制点位置、转角、梁高、底板厚);
  2. 生成各个截面(含内外轮廓,且偏移旋转到指定位置);
  3. 各个截面各轮廓生成棱柱;
  4. 布尔运算,外轮廓棱柱扣减各内轮廓棱柱;
  5. 保存.Brep文件;
  6. 查看效果。

实际的桥梁中,墩顶存在隔板,梁端存在托梁、槽口,隔板还存在人洞,本文暂不涉及这些构造。

代码实现

本文以某个具体桥梁为例来实现全桥建模,桥梁参数见效果栏。

#include <vector>
#include <tuple>
#include <gp_Pnt.hxx>
#include <gp_Circ.hxx>
#include <TopTools_ListOfShape.hxx>
#include <BRepTools.hxx>
#include <BRep_Tool.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <BRepBuilderAPI_MakeWire.hxx>
#include <BRepOffsetAPI_ThruSections.hxx>
#include <BRepPrimAPI_MakeBox.hxx>
#include <BRepPrimAPI_MakePrism.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <ShapeAnalysis_Edge.hxx>
#include <ShapeAnalysis_WireOrder.hxx>
#include <AIS_Shape.hxx>
#include <BRepAlgoAPI_Cut.hxx>
#pragma comment(lib, "TKernel.lib")
#pragma comment(lib, "TKMath.lib")
#pragma comment(lib, "TKG2d.lib")
#pragma comment(lib, "TKG3d.lib")
#pragma comment(lib, "TKGeomBase.lib")
#pragma comment(lib, "TKGeomAlgo.lib")
#pragma comment(lib, "TKBRep.lib")
#pragma comment(lib, "TKTopAlgo.lib")
#pragma comment(lib, "TKShHealing.lib")

#define pi 3.141592653589793  //π值预定义

//通过初始数据生成边
std::vector<TopoDS_Edge> GetEdges(std::vector<std::tuple <double, double, double>> tuples)
{
	std::vector<TopoDS_Edge> anEdges;
	for (int i = 0; i < tuples.size(); ++i)
	{
		int i1 = i;
		int i2 = (i + 1) % tuples.size();
		BRepBuilderAPI_MakeEdge tempRdge(gp_Pnt(std::get<0>(tuples[i1]), std::get<1>(tuples[i1]), std::get<2>(tuples[i1])),
			gp_Pnt(std::get<0>(tuples[i2]), std::get<1>(tuples[i2]), std::get<2>(tuples[i2])));
		anEdges.push_back(tempRdge.Edge());
	}
	return anEdges;
}

//通过边生成形状
TopTools_ListOfShape GetShape(std::vector<TopoDS_Edge> edges)
{
	TopTools_ListOfShape aOrderedEdges;
	for (int e = 0; e < edges.size(); ++e)
	{
		const TopoDS_Edge& anEdge = edges[e];
		aOrderedEdges.Append(anEdge);
	}
	return aOrderedEdges;
}

//通过边生成BRepBuilderAPI_MakeWire
BRepBuilderAPI_MakeWire GetWire(std::vector<TopoDS_Edge> outerEdges)
{
	TopTools_ListOfShape aOrderedEdges = GetShape(outerEdges);
	BRepBuilderAPI_MakeWire aWireMaker;
	aWireMaker.Add(aOrderedEdges);
	return aWireMaker;
}

//生成截面定位点信息,未偏置和旋转
std::vector<std::vector<std::tuple <double, double, double>>> GetBoundaryPoints(double height, double bottomThick)
{
	double topWidth = 16.00;
	double bottomWidth = 11.00;
	double edgeThick = 0.2;
	double rootThick = 0.80;
	double charmerWidth = 0.30;
	double charmerHeight = 0.30;
	double deckThick = 0.60;
	double topThick = 0.30;

	std::vector<std::tuple <double, double, double>> tuples;
	tuples.push_back(std::make_tuple(-topWidth / 2, 0, 0.0));
	tuples.push_back(std::make_tuple(topWidth / 2, 0, 0.0));
	tuples.push_back(std::make_tuple(topWidth / 2, -edgeThick, 0.0));
	tuples.push_back(std::make_tuple(bottomWidth / 2, -rootThick, 0.0));
	tuples.push_back(std::make_tuple(bottomWidth / 2, -height, 0.00));
	tuples.push_back(std::make_tuple(-bottomWidth / 2, -height, 0.0));
	tuples.push_back(std::make_tuple(-bottomWidth / 2, -rootThick, 0.0));
	tuples.push_back(std::make_tuple(-topWidth / 2, -edgeThick, 0.0));

	std::vector<std::vector<std::tuple <double, double, double>>> outerTuples;
	outerTuples.push_back(tuples);
	for (int i = 0; i < 2; ++i)
	{
		std::vector<std::tuple <double, double, double>> outerTuple;
		double gridWidth = bottomWidth / 2 - deckThick * 1.5;
		double midX = (i == 0 ? -1 : 1) * (bottomWidth / 4 - deckThick / 4);
		outerTuple.push_back(std::make_tuple(midX - gridWidth / 2 + charmerWidth, -topThick, 0.0));
		outerTuple.push_back(std::make_tuple(midX - gridWidth / 2, -topThick - charmerHeight, 0.0));
		outerTuple.push_back(std::make_tuple(midX - gridWidth / 2, -height + bottomThick + charmerHeight, 0.0));
		outerTuple.push_back(std::make_tuple(midX - gridWidth / 2 + charmerWidth, -height + bottomThick, 0.0));
		outerTuple.push_back(std::make_tuple(midX + gridWidth / 2 - charmerWidth, -height + bottomThick, 0.0));
		outerTuple.push_back(std::make_tuple(midX + gridWidth / 2, -height + bottomThick + charmerHeight, 0.0));
		outerTuple.push_back(std::make_tuple(midX + gridWidth / 2, -topThick - charmerHeight, 0.0));
		outerTuple.push_back(std::make_tuple(midX + gridWidth / 2 - charmerWidth, -topThick, 0.0));
		outerTuples.push_back(outerTuple);
	}
	return outerTuples;
}

//点偏移和旋转
std::tuple <double, double, double> Transform(std::tuple <double, double, double> inputPoint, std::tuple <double, double, double> centerPoint, double angle)
{
	double x1 = std::get<0>(centerPoint)+ std::get<0>(inputPoint) * cos(angle);
	double y1 = std::get<1>(centerPoint)+ std::get<1>(inputPoint);
	double z1 = std::get<2>(centerPoint) + std::get<0>(inputPoint) * sin(angle);
	return std::make_tuple(x1, y1, z1);
}

//实际位置截面(经过偏移和旋转)
std::vector<std::vector<std::tuple <double, double, double>>> GetBoundaryPoints(std::tuple <double, double, double> centerPoint, double angle, double height, double bottomThick)
{
	std::vector<std::vector<std::tuple <double, double, double>>> sectionBoundaries = GetBoundaryPoints(height, bottomThick);
	std::vector<std::vector<std::tuple <double, double, double>>> transformedBoundaries;
	for (int i = 0; i < sectionBoundaries.size(); ++i)
	{
		std::vector<std::tuple <double, double, double>> transformedBoundary;
		for (int j = 0; j < sectionBoundaries[i].size(); ++j)
		{
			//transformedBoundary.push_back(sectionBoundaries[i][j]);
			transformedBoundary.push_back(Transform(sectionBoundaries[i][j], centerPoint, angle));
		}
		transformedBoundaries.push_back(transformedBoundary);
	}
	return transformedBoundaries;
}

//输出梁高列表(也可以用于板厚)
std::vector<double> GetHeightList(std::vector<double> canSegmentLengthList, double colTopBeamHeight, double midBeamHeight)
{
	double detaHeight = colTopBeamHeight - midBeamHeight;
	double totalLength = 0;
	for (int i = 0; i < canSegmentLengthList.size(); ++i)
	{
		totalLength = totalLength + canSegmentLengthList[i];
	}
	double factorA = detaHeight / (totalLength * totalLength);
	std::vector<double> heightList = { midBeamHeight };
	double detaLength = 0;
	for (int i = 0; i < canSegmentLengthList.size(); ++i)
	{
		detaLength = detaLength + canSegmentLengthList[i];
		double height = factorA * detaLength * detaLength + midBeamHeight;
		heightList.insert(heightList.begin(), height);
	}
	return heightList;
}

//输出里程、梁高、板厚列表
std::vector<std::tuple <double, double, double>> GetStaTupleList(std::vector<double> canSegmentLengthList, double midSta, double equalHeightLength, double colTopBeamHeight, double midBeamHeight, double colTopBottomThick, double midBottomThick)
{
	std::vector<double> heightList = GetHeightList(canSegmentLengthList, colTopBeamHeight, midBeamHeight);//梁高列表
	std::vector<double> bottomThickList = GetHeightList(canSegmentLengthList, colTopBottomThick, midBottomThick);//梁高列表

	std::vector<std::tuple <double, double, double>> staTupleList;
	staTupleList.push_back(std::make_tuple(midSta - equalHeightLength / 2, colTopBeamHeight, colTopBottomThick));
	staTupleList.push_back(std::make_tuple(midSta + equalHeightLength / 2, colTopBeamHeight, colTopBottomThick));
	double staStart = midSta - equalHeightLength / 2;
	double staEnd = midSta + equalHeightLength / 2;
	for (int i = 0; i < canSegmentLengthList.size(); ++i)
	{
		staStart = staStart - canSegmentLengthList[i];
		staEnd = staEnd + canSegmentLengthList[i];
		staTupleList.push_back(std::make_tuple(staEnd, heightList[i + 1], bottomThickList[i + 1]));
		staTupleList.insert(staTupleList.begin(), std::make_tuple(staStart, heightList[i + 1], bottomThickList[i + 1]));
	}
	return staTupleList;
}

//获取位置、角度、梁高、顶板厚列表
//跨径组合65+110+65
//支点梁高6.5,板厚0.8,跨中梁高2.6,板厚0.32
//支点等高段3,变高段52.5,合拢段3,边跨9
//节段划分12+3*3.5+6*4+3*4.5
//起点里程为0,高程为0,终点高程2.4m
//平面在半径1000的圆曲线上
std::vector<std::tuple <std::tuple <double, double, double>, double, double, double>> GetControlMessageList()
{
	double edgeSpanLength = 65;//边跨长
	double midSpanLength = 100;//中跨长
	double colTopBeamHeight = 6.5;//墩顶梁高
	double midBeamHeight = 2.6;//跨中梁高
	double colTopBottomThick = 0.8;//墩顶板厚
	double midBottomThick = 0.32;//跨中板厚
	double equalHeightLength = 3;//墩顶等高段长
	double variableHeightLength = 52.5;//变高段长
	double closedSegmentLength = 2;//合拢段长
	double edgeSegmentLength = 9;//边跨现浇段长
	std::vector<double> canSegmentLengthList = { 4.5,3.5,3.5,3.5,4,4,4,4,4,4,4.5,4.5,4.5 };//T构节段长列表
	std::vector<std::tuple <double, double, double>> staList;//里程,梁高,底板厚

	//计算两个T构的里程,梁高,底板厚
	double midSta = edgeSpanLength; //墩顶中心里程
	std::vector<std::tuple <double, double, double>> list1 = GetStaTupleList(canSegmentLengthList, midSta, equalHeightLength, colTopBeamHeight, midBeamHeight, colTopBottomThick, midBottomThick);
	staList.insert(staList.end(), list1.begin(), list1.end());
	midSta = edgeSpanLength + midSpanLength; //墩顶中心里程
	std::vector<std::tuple <double, double, double>> list2 = GetStaTupleList(canSegmentLengthList, midSta, equalHeightLength, colTopBeamHeight, midBeamHeight, colTopBottomThick, midBottomThick);
	staList.insert(staList.end(), list2.begin(), list2.end());

	//计算两侧边跨段的里程,梁高,底板厚
	double endSta0 = std::get<0>(staList[staList.size() - 1]);
	double endSta1 = endSta0 + closedSegmentLength;
	double endSta2 = endSta0 + (closedSegmentLength+ edgeSegmentLength);
	double startSta0 = std::get<0>(staList[0]);
	double startSta1 = startSta0 - closedSegmentLength;
	double startSta2 = startSta0 - (closedSegmentLength + edgeSegmentLength);
	staList.insert(staList.end(), std::make_tuple(endSta1, midBeamHeight, midBottomThick));
	staList.insert(staList.end(), std::make_tuple(endSta2, midBeamHeight, midBottomThick));
	staList.insert(staList.begin(), std::make_tuple(startSta1, midBeamHeight, midBottomThick));
	staList.insert(staList.begin(), std::make_tuple(startSta2, midBeamHeight, midBottomThick));

	//计算坐标和角度
	std::vector<std::tuple <std::tuple <double, double, double>, double, double, double>> pointTuples;
	for (int i = 0; i < staList.size(); ++i)
	{
		std::tuple <double, double, double> tuple = staList[i];
		double detaSta = std::get<0>(tuple);
		double detaHeight = detaSta * 0.01;//竖向,Y
		double detaSita = detaSta / 1000;
		double sita = pi / 2 - detaSita;
		double detaX = 1000 * cos(sita);//纵向
		double detaY = 1000 - 1000 * sin(sita);//横向
		double beamHeight = std::get<1>(tuple);
		double bottomThick = std::get<2>(tuple);
		std::tuple <double, double, double> point = std::make_tuple(detaY , detaHeight, detaX);
		pointTuples.push_back(std::make_tuple(point, detaSita, beamHeight, bottomThick));
	}
	return pointTuples;
}

//生成全桥
void GenerateBridge()
{
	//生成控制信息
	std::vector<std::tuple <std::tuple <double, double, double>, double, double, double>> pointTuples = GetControlMessageList();

	//生成各个截面
	std::vector<std::vector<std::vector<std::tuple <double, double, double>>>> sections;//所有截面实际定位信息(偏移旋转后)
	for (int i = 0; i < pointTuples.size(); ++i)
	{
		std::tuple <std::tuple <double, double, double>, double, double, double> tuple = pointTuples[i];
		std::tuple <double, double, double> points = std::get<0>(tuple);
		sections.push_back(GetBoundaryPoints(std::get<0>(tuple), std::get<1>(tuple), std::get<2>(tuple), std::get<3>(tuple)));
	}

	//生成截面各轮廓体
	std::vector<BRepOffsetAPI_ThruSections> generators;
	for (int i = 0; i < sections[0].size(); ++i)
	{
		BRepOffsetAPI_ThruSections generator(Standard_True, Standard_False);
		generators.push_back(generator);
	}
	for (int i = 0; i < sections.size(); ++i)
	{
		std::vector<std::vector<std::tuple <double, double, double>>> section = sections[i];
		for (int j = 0; j < section.size(); ++j)
		{
			std::vector<TopoDS_Edge> innerEdges0 = GetEdges(section[j]);
			TopoDS_Wire wire = GetWire(innerEdges0);
			generators[j].AddWire(wire);
		}
	}
	std::vector<TopoDS_Shape> shapes;
	for (int i = 0; i < sections[0].size(); ++i)
	{
		generators[i].Build();
		shapes.push_back(generators[i].Shape());
	}

	//外轮廓体扣减内轮廓体
	TopoDS_Shape S1 = BRepAlgoAPI_Cut(shapes[0], shapes[1]);
	for (int i = 2; i < sections[0].size(); ++i)
	{
		S1 = BRepAlgoAPI_Cut(S1, shapes[i]);
	}

	//输出
	BRepTools::Write(S1, "d:/wire.brep");//保存文件
}

//主函数
int main(int argc, char* argv[])
{
	GenerateBridge();
	return 0;
}

效果

桥梁在半径1000m的圆弧平曲线上,竖曲线为1%的纵坡。全桥跨径组合为65+110+65m,墩顶梁高6.5m,跨中梁高2.8m,顶板厚0.3m,底板厚0.32~0.8m,抛物线次数为2.0次,墩顶水平段3m,变高段52.5m,跨中合拢段和边跨合拢段均为2.0m,边跨现浇段9m,T构节段划分为12+33.5+64+3*4.5m。桥梁立面图纸(已经对称处理)如下:
在这里插入图片描述

全桥三维模型形状如下图(隔板未建模):
在这里插入图片描述

在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2115877.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

长短期记忆神经网络-LSTM回归预测-MATLAB代码实现

一、LSTM简介&#xff08;代码获取&#xff1a;底部公众号&#xff09; 长短期记忆神经网络&#xff08;Long Short-Term Memory, LSTM&#xff09;是一种循环神经网络&#xff08;Recurrent Neural Network, RNN&#xff09;的变体。相比于传统的RNN&#xff0c;LSTM能够更好…

nvidia-smi 随机掉卡,error,禁用GSP功能

问题 NVIDIA 驱动中默认开启加载GPU卡的GSP功能&#xff0c;会随机导致在执行nvidia-smi命令的时候读取GPU卡为ERR状态&#xff0c;或者导致smi命令卡死&#xff1b; 如下图&#xff0c;以A800为例&#xff0c;Centos系统&#xff1b; 涉及到的包含以下型号的GPU卡&#xff…

C#中chart绘制曲线

官网资料&#xff1a;Chart 类 (System.Windows.Forms.DataVisualization.Charting) | Microsoft Learn 类的 Chart 两个重要属性是 Series 和 ChartAreas 属性&#xff0c;这两个属性都是集合属性。 Series集合属性存储Series对象&#xff0c;这些对象用于存储要显示的数据以…

2024年全新deepfacelive简易版-傻瓜式使用教程-采用AI换脸软件deepfacelive

# 2024年全新deepfacelive简易版-傻瓜式使用教程-采用AI换脸软件deepfacelive # 下载安装deepfacelive 官网下载&#xff1a; https://github.com/iperov/DeepFaceLive/ 下载好后放在至少有 30G以上的盘&#xff0c; # 启动使用-设置中文 解压好后&#xff0c;双击.bat批处理…

GPT系列之:GPT-1,GPT-2,GPT-3详细解读

一、GPT1 论文&#xff1a;Improving Language Understanding by Generative Pre-Training 链接&#xff1a;https://cdn.openai.com/research-covers/languageunsupervised/language_understanding_paper.pdf 启发点&#xff1a;生成loss和微调loss同时作用&#xff0c;让下…

java常用集合方法

目录 一、Iterator接口二、Iterable接口三、Collection接口四、Collection与Iterable关系 一、Iterator接口 Iterator 是一个集合迭代器接口&#xff0c;它提供了以下方法&#xff1a; 判断迭代器中是否还拥有元素&#xff0c;有则返回true&#xff0c;否则返回false boolean …

实验八 输入/输出流

实验目的及要求 目的&#xff1a;通过实验掌握java提供的输入/输出包中类的使用&#xff0c;特别是一些常用的类的方法的使用&#xff0c;运用流的概念实现对象的序列化。 要求&#xff1a; &#xff08;1&#xff09;编写程序使用BufferedReader和BufferedWriter对文件进行…

Java高级编程—网络编程(完整详解,包括UDP通信方式、TCP通信方式、TCP三次握手、TCP四次挥手,附有代码+案列)

文章目录 二十九.网络编程29.1 概述29.2 InetAddress29.3 UDP通信29.3.1 UDP通信发送数据29.3.2 UDP通信接收数据29.3.3 Test 29.4 UDP的三种通信方式29.4.1 单播29.4.2 组播29.4.3 广播 29.5 TCP通信29.6 TCP通信三次握手29.7 TCP通信四次挥手29.8 Test29.8.1 多次发送 二十九…

Java数据结构(九)——选择排序、堆排序

文章目录 选择排序算法介绍代码实现复杂度和稳定性 堆排序算法介绍代码实现复杂度和稳定性 选择排序 算法介绍 选择排序是一种简单直观的排序算法。它的工作原理是&#xff1a;首先在未排序序列中找到最小&#xff08;大&#xff09;元素&#xff0c;存放到排序序列的起始位置…

【二分查找】锦集

二分查找锦集 二分前言1. 二分查找1.1 题目来源1.2 题目描述1.3 代码展示 2. 在排序数组中查找元素的第一个和最后一个位置2.1 题目来源2.2 题目描述2.3 解题分析 3. 搜索插入位置3.1 题目来源3.2 题目描述3.3 解题分析 4. x 的平方根4.1 题目来源4.2 题目描述4.3 解题分析 5. …

Oracle rman 没有0级时1级备份和0级大小一样,可以用来做恢复 resetlogs后也可以

文档说了 full backup 不能 用于后续的level 1&#xff0c;没说level 1没有level 0 是不是level 1就是level 0&#xff1f; 1级备份变0级的原因 及 Enabling Change Tracking生效没有-CSDN博客 这个文档说明1级备份时没有找到0级就是0级备份&#xff0c;可以用来完整恢复的。…

春日美食家:SpringBoot网上订餐系统

1 绪论 1.1 研究背景 随着互联网技术的快速发展&#xff0c;网络时代的到来&#xff0c;网络信息也将会改变当今社会。各行各业在日常企业经营管理等方面也在慢慢的向规范化和网络化趋势汇合[13]。电子商务必将成为未来商务的主流&#xff0c;因此对于餐饮行业来说&#xff0c;…

51单片机的无线病床呼叫系统【proteus仿真+程序+报告+原理图+演示视频】

1、主要功能 该系统由AT89C51/STC89C52单片机LCD1602显示模块温湿度传感器模块矩阵按键时钟模块等模块构成。适用于病床呼叫系统、16床位呼叫等相似项目。 可实现基本功能: 1、LCD1602实时显示北京时间、温湿度信息、呼叫床位等信息&#xff1b; 2、DHT11采集病房温湿度信息&…

RTMP播放器延迟最低可以做到多少?

技术背景 RTMP播放器的延迟可以受到多种因素的影响&#xff0c;包括网络状况、推流设置、播放器配置以及CDN分发等。因此&#xff0c;RTMP播放器的延迟并不是一个固定的数值&#xff0c;而是可以在一定范围内变化的。 正常情况下&#xff0c;网上大多看到的&#xff0c;针对R…

【GIS系列】通过Java代码高效实现ArcGIS SDE数据库的数据叠加分析

作者&#xff1a;后端小肥肠 &#x1f347; 我写过的文章中的相关代码放到了gitee&#xff0c;地址&#xff1a;xfc-fdw-cloud: 公共解决方案 &#x1f34a; 有疑问可私信或评论区联系我。 &#x1f951; 创作不易未经允许严禁转载。 本文涉及GDAL及GeoTools代码实践&#xff…

计算机毕业设计选题推荐-宠物店管理系统-Java/Python项目实战

✨作者主页&#xff1a;IT毕设梦工厂✨ 个人简介&#xff1a;曾从事计算机专业培训教学&#xff0c;擅长Java、Python、微信小程序、Golang、安卓Android等项目实战。接项目定制开发、代码讲解、答辩教学、文档编写、降重等。 ☑文末获取源码☑ 精彩专栏推荐⬇⬇⬇ Java项目 Py…

机器学习(9.2-9.8)pytorch学习(二)

文章目录 摘要Abstract 1 torch 和 torchvision1.1 查看CIFAR10数据集内容1.2 Dataloader的使用 2 神经网络的构建2.1 神经网络的基本骨架2.2 卷积层原理2.2.1 卷积基本原理2.2.2 padding 2.3 构建一个卷积神经网络2.4 池化层2.5 非线性激活2.5.1 RELU的使用2.5.2 Sigmoid的使用…

【开源免费】基于SpringBoot+Vue.J大学生租房平台(JAVA毕业设计)

本文项目编号 T 019 &#xff0c;文末自助获取源码 \color{red}{T019&#xff0c;文末自助获取源码} T019&#xff0c;文末自助获取源码 目录 一、系统介绍二、演示录屏三、启动教程四、功能截图五、文案资料5.1 选题背景5.2 国内外研究现状5.3 可行性分析 六、核心代码6.1 查…

java基础概念21-权限修饰符、代码块

一、权限修饰符 1-1、作用 权限修饰符&#xff0c;是用来控制一个成员能够被访问的范围的。 可以修饰&#xff1a;成员变量&#xff0c;方法&#xff0c;构造方法&#xff0c;内部类。 1-2、权限修饰符的分类 二、代码块 局部代码块构造代码块静态代码块 2-1、局部代码块 …

【C++ Primer Plus习题】12.5

大家好,这里是国中之林! ❥前些天发现了一个巨牛的人工智能学习网站&#xff0c;通俗易懂&#xff0c;风趣幽默&#xff0c;忍不住分享一下给大家。点击跳转到网站。有兴趣的可以点点进去看看← 问题: 解答: main.cpp #include <iostream> #include <cstdlib> #in…