Thursday, June 8, 2017

uva problem solution 10170 - The Hotel with Infinite Rooms

problem link:

Discuss: In this problem you can use while loop.substitute s from d while d greater then 0.and increase s with one in every loop then print s-1 the number of team members on this day


try yourself before see the code



uva problem solution 1585 - Score

problem link:

Discuss: in this problem you can use for loop for count 0 and a variable to count the position value of 0.if there is sequence of 0's then increase the value of position variable and add it with sum.if it is not 0 then make the value of position variable 1.

try yourself before see the code


uva problem solution 12531 - Hours and Minutes

problem link:

Discuss: in this problem just look at input if the angle is divided by 6 which is angle for every min has a repeated angle.so we just need to check the angle determine weather it has a repeated angle or not.


try yourself before see the code



Wednesday, June 7, 2017

uva problem soltuion 11849 - CD

problem link:

Discuss: In this problem you can easily do with map.you can also do it by for loop. here i am using map.in at just simply increment the number which duplicate.

try yourself before see the code



Tuesday, June 6, 2017

uva problem solution 10935 - Throwing cards away I

problem link:


Discuss: in this problem you have to print first element from queue and pop second element and then push it again in queue. and print the last element.

if you know queue then it's simple problem for you.clear queue using while loop


try yourself before see the code


Monday, June 5, 2017

uva problem solution 494 - Kindergarten Counting Game


problem link:

Discuss : In this problem you can check str[i] th element in range a to z or A to Z
if it is then make word increment and flag=0 if str[i] th element not in the range then make flag again 1.

 try yourself before see the code


Thursday, June 1, 2017

Uva problem solution 11743 - Credit Check


problem link

Discuss: This is just easy applied problem.You can take input using %1d specifier or using char string.then easily calculate the value and check last digit using remainder.

try yourself before see the code