Sudarshan Agrawal
自 2018 起处于活动状态
Followers: 0 Following: 0
Feeds
提问
2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder. Write a function called smallest_multiple that returns a uint64, the smallest positive number that is evenly divisible by all of the numbers fr
function a=smallest_multiple(n) a=1; x=mod(a,(1:n)); while sum(x)~=0 a=a+1; x=mod(a,(1:n)); if a>in...
6 years 前 | 0 个回答 | 0
0
个回答已回答
Write a function called fare that computes the bus fare one must pay in a given city based on the distance travelled. Here is how the fare is calculated: the first mile is $2. Each additional mile up to a total trip distance of 10 miles is 25 cents.
function cost = fare(dist,age) x=round(dist); if x>=0 && x<=1 f=2; if x>1 && x<=10 f=2+(0.25*(...
Write a function called fare that computes the bus fare one must pay in a given city based on the distance travelled. Here is how the fare is calculated: the first mile is $2. Each additional mile up to a total trip distance of 10 miles is 25 cents.
function cost = fare(dist,age) x=round(dist); if x>=0 && x<=1 f=2; if x>1 && x<=10 f=2+(0.25*(...
6 years 前 | 0
提问
Write a function called fare that computes the bus fare one must pay in a given city based on the distance travelled. Here is how the fare is calculated: the first mile is $2. Each additional mile up to a total trip distance of 10 miles is 25 cents.
function a = fare(dist,age) x=round(dist); if x>=0 && x<=1 fare=2; if x>1 && x<=10 fare=2+(0.2...
6 years 前 | 4 个回答 | 0