Question:
write a program to ask user about the date(year, month and day), then calculate the day of the year.
Sample input:
Year: 2016
Month: 6
Day: 23
Sample output:
Day of the year: 175
Hint:
You need consider leap years and non leap years, in order to do easier calculation, you may...
Posted at 04:00h
in
Uncategorized
by admin
Use Stack to solve the following question:
You are given an array A of Q integers and Q queries. In each query, you are given an integer i (1≤i≤N).
Your task is to find the minimum index greater than i (1≤i≤N) such that:
Sum of digits of Ai is greater than the sum of digits of Aj
Ai < Aj
If there is no answer, then print -1.
Input...
Posted at 03:49h
in
Uncategorized
by admin
Question:
Continue modify the program in the last class, if your fighter touches the enemy:
the fighter will explode
the game status will be STATUS_GAMEOVER
when game over, everything will not show on the screen except for the background and planets.
...
Question for Linear Search:
Creatnx now wants to decorate his house by flower pots. He plans to buy exactly N ones. He can only buy them from Triracle’s shop. There are only two kind of flower pots available in that shop. The shop is very strange. If you...
Posted at 03:44h
in
Uncategorized
by admin
Question for Linear Search:Creatnx now wants to decorate his house by flower pots. He plans to buy exactly N ones. He can only buy them from Triracle's shop. There are only two kind of flower pots available in that shop. The shop is very strange. If you...
Question:A series of streams run down the side of a mountain. The mountainside is very rocky so the streams split and rejoin many times. At the foot of the mountain, several streams emerge as rivers. Your job is to compute how much water flows in...