Basic exercise: The sound of a fish

Source: Internet
Author: User

Writing this question is to give yourself a lesson from codevs1275 FROM2012CCC Canadian High School Information Olympiad

The topic is very simple to judge the monotony of the code as follows

#include <iostream>
using namespace std;

int main () {
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    if (a<b) {
        if (b<c) && (c<d)) cout<< "Fish Rising";
        else cout<< "No Fish";
        return 0;
    }
    if (a==b) {
        if (b==c) && (c==d)) cout<< "Fish at Constant Depth";
        else cout<< "No Fish";
        return 0;
    }
    if (a>b) {
        if (b>c) && (c>d)) cout<< "Fish Diving";
        else cout<< "No Fish";
        return 0;
    }
    return 0;
}

It's the first time you compile it, but because if you have a few conditions behind it, you're going to cry. In a curly brace. The habits of the P-party era still can't be changed.

The second time has not been unexpectedly because of = = = This problem I do not know what to say

Learn from the end of the final refueling good review evening less dry chores early to sleep to improve the efficiency of morning reading

--there is no article to frighten the domestic, the Jianggan horse in the car

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.