Uva 11547 Automatic Answer Solution

Problem Link
Uva 11547 Automatic Answer Solution
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {

        int n;
        cin>>n;
        n=n*567;
        n=n/9;
        n=n+7492;
        n=n*235;
        n=n/47;
        n=n-498;
        n=n/10;
        n=n%10;   //This is for tens column digit.
        if(n<0)
            n=n*(-1);
        cout<<n<<endl;
    }
    return 0;
}

No comments

Theme images by enjoynz. Powered by Blogger.