Quantcast
Channel: CodeChef Discuss - latest questions
Viewing all articles
Browse latest Browse all 40121

Hs08TEST: Getting Wrong Answer

$
0
0

BElow is the code i generated and it matches the test cases output with ease on my system.

However When i submit it here, I keep getting wrong answer. Any helpful insights ?

#include <iostream>
using namespace std ;

int main (void)
{

    float X,Y, Z; // amount to be withdrawn ,available balance and amount after transaction

    cin>> X>> Y;

    if ((((int)X % 5) !=0 ) || (X > 2000)) // wrong entry or insufficient funds

            cout<<Y<<endl;

    else
        if(X> Y)

        cout<<Y<<endl;

    else
        {
        Z=(Y-(X+0.5));
        cout<< Z;//display balance after transaction
        }
    return 0;

}

Viewing all articles
Browse latest Browse all 40121

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>