CODE[VS] 1275有鱼的声音 2012年CCC加拿大高中生信息学奥赛
A ?sh-?nder is a device used by anglers to ?nd ?sh in a lake. If the ?sh-?nder ?nds a ?sh, it will sound an alarm. It uses depth readings to determine whether to sound an alarm. For our purposes, the ?sh-?nder will decide that a ?sh is swimming past if:
fish-finder是一個(gè)神奇的裝置供垂釣者使用區(qū)在護(hù)理釣魚。如果一個(gè)f-f找到了一條魚,他會(huì)響起聲音警報(bào)。它用魚的深度來(lái)決定是否響警報(bào)。我們的目的就是要決定魚是否通過(guò),具體如下:
? there are four consecutive depth readings which form a strictly increasing sequence (such as 3 4 7 9) (which we will call “Fish Rising”), or
如果連續(xù)的四個(gè)深度讀入是嚴(yán)格遞增的序列,我們可以叫它?Fish Rising 。
? there are four consecutive depth readings which form a strictly decreasing sequence (such as 9 6 5 2) (which we will call “Fish Diving”), or
如果連續(xù)的四個(gè)深度讀入是嚴(yán)格遞減的序列,我們可以叫它?Fish Diving 。
? there are four consecutive depth readings which are identical (which we will call “Constant Depth”).
All other readings will be considered random noise or debris, which we will call “No Fish.”
Your task is to read a sequence of depth readings and determine if the alarm will sound.
如果連續(xù)的四個(gè)深度讀入是一樣的,那就是“Fish At?Constant Depth”。如果都不是,就是“No Fish”。
?
輸入描述?Input DescriptionThe input will be four positive integers, representing the depth readings. Each integer will be on its own line of input.
輸入會(huì)是四個(gè)正整數(shù),代表深度讀入。每個(gè)整數(shù)會(huì)占一行。
輸出描述?Output DescriptionThe output is one of four possibilities. If the depth readings are increasing, then the output should be Fish Rising. If the depth readings are decreasing, then the output should be Fish Diving. If the depth readings are identical, then the output should be Fish At Constant Depth. Otherwise, the output should be No Fish.
輸出就是四種情況。
?
樣例輸入?Sample Input樣例1:
30 10 20 20
樣例2:
1 10 12 13
樣例輸出?Sample Output樣例1:
No Fish
樣例2:
Fish Rising
?
數(shù)據(jù)范圍及提示?Data Size & Hint數(shù)據(jù)很小
?
?
學(xué)考完之后第一天回到機(jī)房。。。
啥也不想干。
?
然后首先是被通知可歆妹子即將要過(guò)生日。
卻不知道送啥。
?
然后再就是說(shuō)暑期出去培訓(xùn)的事兒。
made我怎么可能單獨(dú)跟一個(gè)我十分討厭的人住一起呢。
我當(dāng)然誓死和61級(jí)妹子們?cè)谝粔K兒了。
?
機(jī)房蚊子真多。。。
?
?
1 #include<iostream> 2 #include<cstdio> 3 #include<algorithm> 4 #include<cmath> 5 #include<cstring> 6 using namespace std; 7 8 int a[5]; 9 int up,down,as; 10 11 int main() 12 { 13 for(int i=1;i<=4;++i) 14 scanf("%d",&a[i]); 15 for(int i=1;i<4;++i) 16 { 17 if(a[i+1]>a[i]) up++; 18 if(a[i+1]<a[i]) down++; 19 if(a[i+1]==a[i]) as++; 20 } 21 if(up==3) printf("Fish Rising"); 22 else if(down==3) printf("Fish Diving"); 23 else if(as==3) printf("Fish At Constant Depth"); 24 else printf("No Fish"); 25 return 0; 26 } 簡(jiǎn)單的模擬?
?
如果你不開心,那我就把右邊這個(gè)帥傻子分享給你吧,
你看,他這么好看,跟個(gè)zz一樣看著你,你還傷心嗎?
真的!這照片盯上他五秒鐘就想笑了。
一切都會(huì)過(guò)去的。
時(shí)間時(shí)間會(huì)給你答案2333
?
?
轉(zhuǎn)載于:https://www.cnblogs.com/Mary-Sue/p/9236281.html
總結(jié)
以上是生活随笔為你收集整理的CODE[VS] 1275有鱼的声音 2012年CCC加拿大高中生信息学奥赛的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 团队作业5-Alpha版本测试报告(彼岸
- 下一篇: 模板下载