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是一個神奇的裝置供垂釣者使用區在護理釣魚。如果一個f-f找到了一條魚,他會響起聲音警報。它用魚的深度來決定是否響警報。我們的目的就是要決定魚是否通過,具體如下:
? 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
如果連續的四個深度讀入是嚴格遞增的序列,我們可以叫它?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
如果連續的四個深度讀入是嚴格遞減的序列,我們可以叫它?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.
如果連續的四個深度讀入是一樣的,那就是“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.
輸入會是四個正整數,代表深度讀入。每個整數會占一行。
輸出描述?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
?
數據范圍及提示?Data Size & Hint數據很小
?
?
學考完之后第一天回到機房。。。
啥也不想干。
?
然后首先是被通知可歆妹子即將要過生日。
卻不知道送啥。
?
然后再就是說暑期出去培訓的事兒。
made我怎么可能單獨跟一個我十分討厭的人住一起呢。
我當然誓死和61級妹子們在一塊兒了。
?
機房蚊子真多。。。
?
?
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 } 簡單的模擬?
?
如果你不開心,那我就把右邊這個帥傻子分享給你吧,
你看,他這么好看,跟個zz一樣看著你,你還傷心嗎?
真的!這照片盯上他五秒鐘就想笑了。
一切都會過去的。
時間時間會給你答案2333
?
?
轉載于:https://www.cnblogs.com/Mary-Sue/p/9236281.html
總結
以上是生活随笔為你收集整理的CODE[VS] 1275有鱼的声音 2012年CCC加拿大高中生信息学奥赛的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 团队作业5-Alpha版本测试报告(彼岸
- 下一篇: 模板下载