C - map

You have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunately, you have a dictionary to help you understand them.

Input

Input consists of up to 100,000 dictionary entries, followed by a blank line, followed by a message of up to 100,000 words. Each dictionary entry is a line containing an English word, followed by a space and a foreign language word. No foreign word appears more than once in the dictionary. The message is a sequence of words in the foreign language, one word on each line. Each word in the input is a sequence of at most 10 lowercase letters.

Output

Output is the message translated to English, one word per line. Foreign words not in the dictionary should be translated as "eh".

Sample Input

dog ogday
cat atcay
pig igpay
froot ootfray
loops oopslay

atcay
ittenkay
oopslay

Sample Output

cat
eh
loops

Hint

Huge input and output,scanf and printf are recommended.

判断输入结束时这个方法挺好用。

#include <iostream>
#include <map>
#include <cstdio>
using namespace std;

int main()
{
    map<string,string> d;
    char s1[10000]= {0},s2[10000]= {0},str[20001];
    while(gets(str)&&str[0]!='\0')
    {
        sscanf(str,"%s%s",s1,s2);
        d[s2]=s1;
    }
    while(gets(s1))
    {
        if(d.find(s1)!=d.end())
            cout<<d[s1]<<endl;
        else
            printf("eh\n");
    }
    return 0;
}
 

 

C-MAPSS(Commercial Modular Aeropropulsion System Simulation)是一种用于航空发动机仿真的高保真动态模型,广泛应用于航空推进系统的研究与开发中。该模型由美国国家航空航天局(NASA)与行业合作伙伴共同开发,旨在提供一个标准化的仿真平台,以支持航空发动机控制设计、故障诊断、健康管理(PHM)以及性能优化等方面的研究[^1]。 C-MAPSS 的设计采用模块化架构,能够模拟现代商用涡轮风扇发动机的各个关键部件,包括风扇、低压压气机、高压压气机、燃烧室、高压涡轮和低压涡轮等。这种模块化结构允许用户根据具体需求对模型进行扩展或修改,从而适用于多种研究场景[^1]。 该仿真系统提供了一个与真实发动机控制器(如FADEC - Full Authority Digital Engine Control)兼容的接口,使得研究人员可以在闭环控制环境下测试和验证控制算法。C-MAPSS 支持从稳态到瞬态的多种操作条件,能够模拟发动机在不同飞行阶段和故障状态下的行为,是研究发动机性能退化、故障传播和控制响应的理想工具。 C-MAPSS 的典型应用包括: - **发动机控制设计与验证**:用于开发和测试先进的控制算法,以提高发动机效率和可靠性。 - **故障诊断与预测**:构建基于模型的故障检测与隔离(FDI)系统,并支持剩余使用寿命(RUL)预测。 - **健康管理(PHM)研究**:结合数据驱动方法,进行发动机状态监测和维护策略优化。 - **教育与培训**:为航空工程学生和工程师提供一个真实感强的仿真平台,用于学习发动机工作原理和控制策略。 C-MAPSS 的仿真环境通常与 MATLAB/Simulink 集成,便于用户进行建模、仿真和分析。它提供了一套标准的输入输出接口,方便与外部控制系统或监测系统连接。 ### 示例:C-MAPSS 仿真模型的输入输出接口(示意) ```matlab % 示例输入变量 inputs = struct('ThrottleCmd', 0.8, ... % 油门指令 'AmbientTemp', 288.15, ... % 环境温度 (K) 'AmbientPress', 101325); % 环境压力 (Pa) % 示例输出变量 outputs = struct('Nf', 0, ... % 风扇转速 'Nc', 0, ... % 高压转速 'Wf', 0, ... % 燃油流量 'Tt4', 0); % 涡轮前温度 ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值