Buildings

Input
Standard input will contain multiple test cases. The first line of the input is a single integer T which is the number of test cases. T test cases follow.
The first line of each test case contains two integers n and m(1<=n,m<=100), the size of the campus. Then follow n lines, each line containing m integers. The j-th integer in the i-th line is the color of that grid, 0 stands for white color, while 1 stands for green.
 
Output

            Results should be directed to standard output. For each case, output an integers T, the total green grids in the N*M size campus.
 
Sample Input
2
2 2
1 1
0 0
3 3
1 0 1
0 0 1
1 1 0
 
Sample Output
2
5
#include <iostream>
using namespace std;
int main()
{
	int a,m,n,all;
	cin>>a;
	while (a>0)
	{
		all=0;
		cin>>n>>m;
		n=n*m;
		while (n>0)
		{
			cin>>m;
			all+=m;
			--n;
		}
		cout<<all<<endl;
		--a;
	}
	system("pause");
	return 0;
}

### Modelica Buildings库介绍 Modelica Buildings库是用于建筑和建筑系统建模与仿真的专业库。它基于Modelica语言开发,能够对建筑的热特性、HVAC(供热、通风和空气调节)系统、照明系统等进行详细建模。该库提供了丰富的组件模型,涵盖了从简单的热阻热容模型到复杂的设备级模型,可用于研究建筑的能源性能、系统控制策略以及不同设计方案的比较等。例如在研究建筑能耗时,可以利用库中的模型模拟不同气候条件下建筑的热传递过程以及HVAC系统的运行情况。 ### 使用指南 使用Modelica Buildings库进行建模通常需要以下步骤: 1. **环境搭建**:安装支持Modelica语言的仿真环境,如Dymola、OpenModelica等。 2. **库的导入**:在仿真环境中导入Modelica Buildings库。以Dymola为例,通过“File” - “Open”找到库文件并打开。 3. **模型选择与搭建**:根据研究需求从库中选择合适的模型组件,然后将这些组件连接起来构建完整的系统模型。例如要构建一个简单的建筑热模型,可选择热阻热容模型表示建筑围护结构,再连接上HVAC系统模型。 4. **参数设置**:为模型中的各个组件设置合适的参数,如建筑的面积、围护结构的热传导系数、HVAC系统的功率等。 5. **仿真运行**:设置仿真的时间范围、步长等参数,然后运行仿真。 6. **结果分析**:查看仿真结果,如温度、能耗等数据,并进行分析。 ### 下载 可以通过以下途径下载Modelica Buildings库: - 官方网站:可以访问Modelica Buildings库的官方网站,在网站上找到下载链接进行下载。 - 仿真环境自带:部分仿真环境在安装时可能会自带Modelica Buildings库,或者可以通过环境的库管理功能进行下载和更新。 ```python # 以下为简单示例,假设在Python中使用PyModelica接口(需安装相关依赖) from pymodelica import compile_fmu from pyfmi import load_fmu # 编译FMU fmu = compile_fmu('Buildings.Examples.SimpleBuilding', 'Buildings.mo') # 加载FMU model = load_fmu(fmu) # 设置仿真时间 model.time = (0, 3600) # 运行仿真 res = model.simulate() # 查看结果 print(res['T']) ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值