Solution - UVa Problem 11547 - Automatic Answer
#include<iostream>
using namespace std;
int main()
{
int tstCase;
cin >> tstCase;
for(int i=1; i<=tstCase; i++)
{
int nmbr, nNmbr;
cin >> nmbr;
nNmbr = ((((((nmbr*567)/9)+7492)*235)/47)-498);
nNmbr = (nNmbr/10)%10;
if(nNmbr<0)
nNmbr = -nNmbr;
cout << nNmbr << endl;
}
return 0;
}
আলোচনাঃ
প্রবেলম টি এক বার পড়ে আমি বুঝি নাই, What is the digit in the tens column? এর পর ক্যালকুলেশন করে টোটাল নাম্বার বের করলাম ক্যালকুলেটর এ। দেখলাম দশকের ঘরের নাম্বার টা Answer এর সাথে মিলে যাচ্ছে। ইয়াহ হু.....................
Comments
Post a Comment