Thursday 23 July 2015

EIGHTS


Triple Fat Ladies

Link to the question : EIGHTS 

HINT :

No need to hard code. Just take out your calculator and check for the first few numbers whose cube ends with 888 and observe the pattern. 

Still cant get the pattern?
Here it is : 
1 - 192
2 - 442
3 - 692
4 - 942

RECOMMENDED  QUESTION :

Try solving this question.

SOURCE CODE :

#include<iostream>


using namespace std;

int main()

{

    long long k,t;

    cin>>t;

    while(t--)

    {

        cin>>k;

        cout<<192 + (k-1)*250<<endl;





    }

    return 0;

}

No comments:

Post a Comment