Count ones
Write a program to count number of ones (1s) in an integer variable input.
For example:
Input x=2200112231
output y=3
I...
2年以上 前
解決済み
Mode
Find the mode of the vector
Assumption: no vector is bimodal
Example 1: input=[1 2 3 4 4]; output=4
Example 2: input=[7...
2年以上 前
解決済み
Unit conversion
Convert x degree Celsius to y degree Fahrenheit.
2年以上 前
解決済み
Area of a Square
Inside a square is a circle with radius r.
What is the area of the square?
2年以上 前
解決済み
metre to feet converter
The idea is to make a converter, which exchange meters to feets.
We use a factor of 1m = 3.281*1f.
so 3m are equals to 9.843 m...
2年以上 前
解決済み
Sum of the Matrix Elements
Add up all the elements in a NxM matrix where N signifies the number of the rows and M signifies the number of the columns.
E...
2年以上 前
解決済み
Divide by 4
Given the variable x as your input, divide it by four and put the result in y.