Friday, 18 November 2016

11547 - Automatic Answer Uva Problem Solution.


Solution:

#include <bits/stdc++.h>
using namespace std;
/*
    *
    * Prosen Ghosh
    * American International University - Bangladesh (AIUB)
    *
*/
int main() {
    int T,n;
    cin >> T;
    for(int t = 0; t< T; t++){
        cin >> n;
        int res,eq = (((((n*567)/9)+7492)*235)/47)-498;
        eq /= 10;
        res = eq %10;
        cout << abs(res) << endl;
    }
    return 0;
}

No comments:

Post a Comment