UVA-11547 Automatic Answer

#include <stdio.h>
int main()
{
    long int c,i,n,r,s,t,u,j;
    scanf("%ld",&c);
    for(i=1;i<=c;i++)
    {
        r=0;
        s=0;
        t=0;
        scanf("%ld",&n);
        r=(n*567)/9;
        s=(r+7492)*235;
        t=(s/47)-498;
        for(j=1;j<=2;j++)
        {
            u=t%10;
            t=t/10;
        }
        printf("%ld\n",abs(u));
    }
    return 0;
}

Download Coding Interview Book and Get More Tutorials for Coding and Interview Solution: Click Here

Download System Design Interview Book and Get More Tutorials and Interview Solution: Click Here

Do you need more Guidance or Help? Then Book 1:1 Quick Call with Me: Click Here

Share on Google Plus

About Ashadullah Shawon

I am Ashadullah Shawon. I am a Software Engineer. I studied Computer Science and Engineering (CSE) at RUET. I Like To Share Knowledge. Learn More: Click Here
    Blogger Comment
    Facebook Comment

1 comments:

  1. This is very educational content and written well for a change. It's nice to see that some people still understand how to write a quality post! antiderivative calculator

    ReplyDelete