Monday, May 15, 2017

uva problem 10591 - Happy Number


problem link

Discussion : In this problem  make sum of every digit of number. if until the sum less then 10 or 1. replace n with sum. if sum=1 then number is happy otherwise unhappy.

at first try yourself,if you can't then only see the code.


uva problem 11650 - Mirror Clock


problem link:


It is just a simple problem to solve.Just subtract hour from 11. if it is less than or equal 0 then add 12 with hour. and for min if it is not equal to zero than subtract min from 60.  and for align use %02 specifier .


at first try yourself but if you can't then only see the code.


11389 - The Bus Driver Problem uva problem



problem linkk:

Discussion : in this problem we just have to sort the evening and morning hours. then add with smallest one with greatest one then compare it with d.  if it exceed then multiple with over time rate


Saturday, May 6, 2017

12614-Earn for future uva problem

problem link:

Discussion: In this problem you just have to find the maximum value of card..and then print it..don't panic with bitwise operator.

here the code..at first try yourself.if you can't then only see the code.otherwise you can't develop yourself in programming.


uva problem-12709 falling ant


problem link:

discussion:  Just compare the value  of H if H is large then downward acceleration also large..
if H and large H is equal then compare the volume of them the large volume should assign to the large volume.

here are the code, before see the code try yourself first. otherwise you can't develop in programmin


Friday, May 5, 2017

138-Street number uva problem

problem link:


#include<stdio.h>
int main()
{
    long long n,x=8,tc=0;
    double n2;
    while(1)
    {
        n2=sqrt((x*x+x)/2);
        n=n2;
        if(n==n2)
        {
            printf("%10lld%10lld\n",n,x);
            tc++;
        }
        if(tc==10)
        break;
        x++;
    }
return 0;
}

Monday, April 24, 2017

uva problem-12897 Decoding baby boss

problem link:


discussion: if you do this program just like compare every element in every exchange  then you will got time limit. so, to avoid this you just set your alphabet order then replace them with desire character. and last compare your alphabet set and replace main string.


try your self first then if you can't see the code,otherwise you can't improve yourself in programming.