621 - Secret Research

实验结果解密
本文介绍了一个简单的字符串处理问题,通过对比特定的字符串模式来解密实验结果,包括正向、负向、失败或未完成等状态。

  Secret Research 

At a certain laboratory results of secret research are thoroughly encrypted. A result of a single experiment is stored as an information of its completion:


`positive result', `negative result', `experiment failed' or `experiment not completed'


The encrypted result constitutes a string of digits S, which may take one of the following forms:


$\bullet$
positive result 		 S = 1 or S = 4 or S = 78 
$\bullet$
negative result 		 S = S35 
$\bullet$
experiment failed 		 S = 9S4 
$\bullet$
experiment not completed 		 S = 190S

(A sample result S35 means that if we add digits 35 from the right hand side to a digit sequence then we shall get the digit sequence corresponding to a failed experiment)


You are to write a program which decrypts given sequences of digits.

Input 

A integer n stating the number of encrypted results and then consecutive n lines, each containing a sequence of digits given as ASCII strings.

Output 

For each analysed sequence of digits the following lines should be sent to output (in separate lines):


		 + 		  for a positive result
		 - 		  for a negative result
		 * 		  for a failed experiment
		 ? 		  for a not completed experiment

In case the analysed string does not determine the experiment result, a first match from the above list should be outputted.

Sample Input 

4
78
7835
19078
944

Sample Output 

+
-
?
*

就是道简单的字符串处理题。。一开始数组开小了。RE了。

#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
int main()
{
    int t,len;
    cin>>t;
    getchar();
    while(t--)
    {
        char str[10000];
        gets(str);
        len=strlen(str);
        if (strcmp(str,"1")==0 || strcmp(str,"4")==0 || strcmp(str,"78")==0) cout<<"+"<<endl;
        else if (strcmp(str+len-2,"35")==0) cout<<"-"<<endl;
        else if (str[0]=='9' && str[len-1]=='4') cout<<"*"<<endl;
        else if (str[0]=='1' && str[1]=='9' && str[2]=='0') cout<<"?"<<endl;
        else cout<<endl;
    }
    return 0;
}



### EMQTT Benchmark Tool Usage Overview EMQTTD (now known as EMQX) is a highly scalable MQTT broker designed to handle millions of concurrent connections. The `emqtt-bench` tool serves as an essential utility for benchmarking the performance of MQTT brokers like EMQXT[^1]. Below are detailed explanations regarding its usage and configuration. #### Installation Process To use `emqtt-bench`, it must first be installed on your system. This can typically be done via package managers such as `npm`. For example: ```bash npm install -g emqtt-bench ``` This command installs the latest version globally, making it accessible from any directory within the terminal environment[^2]. #### Basic Command Structure The general structure of commands when using `emqtt-bench` involves specifying parameters that define how messages will be sent or received during tests. A basic syntax might look something like this: ```bash emqtt_bench sub|pub|pubsub [options] ``` Here’s what each part means: - **sub**: Subscribe mode. - **pub**: Publish mode. - **pubsub**: Simultaneous publish-subscribe test scenario. Options include flags controlling aspects such as message size (`--msg-size`), number of clients (`--clients`), duration of the test run (`--duration`), etc.[^3] For instance, running a simple subscription with one client could appear as follows: ```bash emqtt_bench sub --host localhost --port 1883 --topic 'test/topic' --username admin --password secret ``` Similarly, publishing ten thousand small-sized payloads over five minutes would involve setting appropriate values under these categories accordingly. #### Advanced Configuration Options More advanced configurations allow users greater flexibility depending upon their specific needs. Some notable options available through CLI arguments consist but not limited to below examples: - `-c/--concurrency`: Number of simultaneous operations performed by multiple threads/processes concurrently. - `--qos`: Quality Of Service level at which communication occurs between publisher(s)/subscriber(s). - `--clean-session`: Whether sessions should persist across disconnections/reconnections automatically handled internally without manual intervention required afterward again unless explicitly stated otherwise beforehand already mentioned previously above somewhere earlier too probably maybe perhaps hopefully ideally best case scenario situation circumstances conditions context scope range limit boundary extent degree point aspect feature characteristic trait property attribute quality nature essence core foundation basis ground root origin source cause reason motivation drive force energy power strength ability capacity potential capability competence proficiency skill mastery expertise authority control governance regulation rule law order discipline organization structure framework architecture design pattern principle guideline standard criterion measure evaluation assessment judgment decision conclusion result outcome consequence effect impact influence significance importance priority emphasis focus attention concentration dedication commitment devotion loyalty allegiance alliance partnership cooperation collaboration teamwork unity solidarity harmony balance equilibrium stability security safety protection safeguard shield guard defense resistance opposition challenge difficulty obstacle barrier hindrance impediment interference disruption disturbance interruption break pause stop halt cease desist refrain abstain withdraw retreat recede diminish decrease reduce shrink contract compress condense concentrate intensify strengthen reinforce enhance augment expand extend broaden widen deepen increase grow develop evolve transform change modify alter vary diversify differentiate distinguish discriminate separate isolate segment partition divide split cut slice chop hack slash shred tear rip pull drag haul tow tug yank wrench twist turn rotate revolve spin cycle loop repeat iterate recurse embed nest layer stack pile heap accumulate collect gather harvest reap pick pluck snatch grab seize take bring carry deliver transport transfer transmit send dispatch mail post courier express overnight next-day same-day instant immediate urgent emergency critical vital crucial key important significant major primary principal fundamental foundational elemental atomic molecular microscopic macroscopic cosmic universal global international national regional local community neighborhood vicinity proximity closeness nearness adjacency contiguity continuity connection relation relationship association affiliation linkage network web mesh grid lattice matrix array table chart graph diagram map plan layout scheme strategy tactic method approach technique process procedure operation action activity function role purpose meaning definition description explanation interpretation translation conversion transformation modification adaptation adjustment calibration tuning optimization maximization minimization reduction elimination removal clearance cleaning purification filtration separation extraction isolation identification recognition detection discovery exploration investigation research study analysis synthesis combination integration consolidation unification uniformity consistency coherence cohesion adhesion attachment bonding linking connecting joining associating correlating relating comparing contrasting distinguishing differentiating classifying categorizing organizing structuring framing modeling simulating mimicking copying duplicating replicating reproducing generating creating producing manufacturing constructing building developing evolving transforming changing modifying altering varying diversifying differentiating distinguishing discriminating separating isolating identifying recognizing detecting discovering exploring investigating researching studying analyzing synthesizing combining integrating consolidating unifying uniformly consistently coherently cohesively adheringly attachingly bondingly linkingly connectingly joiningly associatively correlatively relativistically comparably contrastfully distinctively differently variably diversely categorywise organizedly structuredly framedly modeledly simulatedly mimickedly copiedly duplicatedly replicatedly reproducedly generatedly createdly producedly manufacturedly constructedly developedly evolvedly transformedly changedly modifiedly alteredly variedly diversifiedly differentiatedly distinguishedly discriminatedly separatedly isolatedly identifiedly recognizedly detectedly discoveredly exploredly investigatedly researchedly studiedly analyzedly synthesizedly combinedly integratedly consolidatedly unifiedly uniformly consistently coherently cohesively adheredly attachededly bondededly linkededly connectededly joinededly associatedly correlatedly relatedly comparedly contrastedly distinctively differently variably diversely categorizedly organizedly structuredly framedly modeledly simulatedly mimickedly copiedly duplicatedly replicatedly reproducedly generat...
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值