标签:style 输入 mod ase while for printf break NPU
The prime factors of 13195 are 5, 7, 13 and 29.
What is the largest prime factor of the number 600851475143 ?
Solve:
clear
clc
t = input(‘pelase input the number:‘); %输入任意一个正整数
for i = 2:t-1
while mod(t,i) == 0
t = t/i;
end
if t == 1;
a = i;
break
end
end
fprintf(‘The answer is %.0d\n‘,a)
标签:style 输入 mod ase while for printf break NPU
原文地址:https://www.cnblogs.com/JerryBerry/p/10602712.html