【发布时间】:2015-10-29 06:08:48
【问题描述】:
a = input('What is the name of the exoplanet? ','s');
mass = input('What is the mass of %s (kg)? ', a)
radius = input('What is the estimated radius of %s (km)? ', a)
masssp = input('What is the mass of the specimen (kg) ')
newton = (mass * radius)/masssp
fprintf('On %s , it would weight approxomately %d Newtons ', s, newton)
【问题讨论】:
标签: string matlab input string-formatting user-input