Sums of cubes and squares of sums
Given the positive integers 1:n, can you:
1. Compute twice the sum of the cubes of those numbers.
2. Subtract the square...
Make a Palindrome Number
Some numbers like 323 are palindromes. Other numbers like 124 are not. But look what happens when we add that number to a revers...
8 years 前
已解决
Reverse Run-Length Encoder
Given a "counting sequence" vector x, construct the original sequence y.
A counting sequence is formed by "counting" the entrie...
8 years 前
已解决
De-dupe
Remove all the redundant elements in a vector, but keep the first occurrence of each value in its original location. So if
a =...
Check that number is whole number
Check that number is whole number
Say x=15, then answer is 1.
x=15.2 , then answer is 0. <http://en.wikipedia.org/wiki/Whole...
8 years 前
已解决
Is the paranthesis sequence balanced ?
Quantum mechanics and computer science are interested in <http://en.wikipedia.org/wiki/Bra%E2%80%93ket_notation bra-kets>. Today...
8 years 前
已解决
Writing a while loop
Write a while loop that continues to increment userValue by 5 until userValue is less than 0.
8 years 前
已解决
Double summation
Write two nested for loops to calculate the following double summation:
<<https://drive.google.com/uc?id=0B74PAULDIwwsWFhlNTV...
8 years 前
已解决
While loop with branching
Write a while loop that adjusts userValue while userValue is less than 0 or greater than 80. If userValue is greater than 80, th...
8 years 前
已解决
Compute change
A cashier distributes change using the maximum number of five dollar bills, followed by one dollar bills. Given amountToChange, ...