Sample Exam – Miss Cat (100/100)

There are two things that cats love most: 1) sleeping and 2) attending beauty contests. The most important thing for each female cat is the contest “Miss Cat”. There are always ten cats that participate in the final round of the contest, numbered 1 to 10.
The jury of the contest consists of N people who subjectively decide which cat to vote for. In other words each person votes for just 1 cat that he has most liked, or from whose owner he has received the biggest bribe. The winner of the contest is the cat that has gathered most votes. If two cats have equal votes, the winner of the contest is the one whose number is smaller.
Your task is to write a computer program that finds the number of the cat that is going to win the contest “Miss cat”

[C#]Loops – 13*

* Write a program that calculates for given N how many trailing zeros present at the end of the number N!. Examples:
N = 10  N! = 3628800  2
N = 20  N! = 2432902008176640000  4
Does your program work for N = 50 000?
Hint: The trailing zeros in N! are equal to the number of its prime divisors of value 5. Think why!

[C#]Loops – 12

Write a program that reads from the console a positive integer number N (N < 20) and outputs a matrix like the following: for N=3

[C#]Loops – 11

Write a program that prints all possible cards from a standard deck of 52 cards (without jokers). The cards should be printed with their English names. Use nested for loops and switch-case.