Cody

Problem 1204. Prime Time

Solution 2023923

Submitted on 16 Nov 2019
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
filetext = fileread('prime_time.m') assert(isempty(strfind(filetext, 'fopen')))

filetext = 'function y = prime_time(x) y = x; end %This code written by profile_id 615500 '

2   Fail
x=123 y = prime_time(x) a=clock b=floor(polyval(a(5:6),60)) if isprime(b) y_correct= y else y_correct = NaN; end assert(isequal(y,y_correct),sprintf('%s%g%s','Time is ',datestr(now,13),', or ',b,' seconds after the hour.'))

x = 123 y = 123 a = 1.0e+03 * 2.0190 0.0110 0.0160 0.0060 0.0270 0.0470 b = 1666

Time is 486:27:47, or 1666 seconds after the hour.