日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

UVA 621 Secret Research

發(fā)布時(shí)間:2024/4/14 编程问答 24 豆豆
生活随笔 收集整理的這篇文章主要介紹了 UVA 621 Secret Research 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

額。。 不理解這題為什么會(huì)是數(shù)學(xué)題 0.0 可能是輸入中有很長(zhǎng)的字符串需要處理,然后獲得字符串的位數(shù)是一個(gè)需要技巧的過(guò)程? 不過(guò)我直接STL過(guò)的 。。。真心感覺(jué)STL很方便 但是也不能依賴(lài)STL額。。順便總結(jié)一下輸出的時(shí)候如果沒(méi)要求最后不輸出回車(chē) 最后一定要輸出回車(chē) 否則就會(huì)WAWAWA 我在這栽了三次 = =

以下是題和AC代碼

? 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:

?

positive result S = 1 or S = 4 or S = 78 negative result S = S35 experiment failed S = 9S4 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?

+ - ? * 1 #include<iostream> 2 #include<string> 3 #include<stdlib.h> 4 #include<stdio.h> 5 using namespace std; 6 7 int main(void) 8 { 9 //freopen("621.in", "r", stdin); 10 long long n; 11 scanf("%lld", &n); 12 for (long long i = 0; i < n; i++) 13 { 14 string s; 15 int flag; 16 cin >> s; 17 if (s == "1" || s == "4" || s == "78") { printf("+\n"); continue; } 18 else if (s[s.size() - 1] == '5' && s[s.size() - 2] == '3') { printf("-\n"); continue; } 19 else if (s[0] == '9' && s[s.size() - 1] == '4') { printf("*\n"); continue; } 20 else if (s[0] == '1' && s[1] == '9' && s[2] == '0') { printf("?\n"); continue; } 21 22 } 23 //system("pause"); 24 return 0; 25 }

?

轉(zhuǎn)載于:https://www.cnblogs.com/VOID-133/p/3586464.html

總結(jié)

以上是生活随笔為你收集整理的UVA 621 Secret Research的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。