雅虎2014校园招聘软件开发工程师笔试试题,选择题第七题

clc;clear;close all;

Num = 1000;
sum = 0;
Result = [];
for N = 1:Num
    for i=1:N
        sum = sum + N/i;
    end
    sum = sum/N;
    
    Result = [Result sum];
end
x = 1:Num;
y1 = log(x);
y2 = x.^0.5;
plot(x,Result,'r.',x,y1,'b.',x,y2,'g.'); grid on;

你可能感兴趣的:(雅虎2014校园招聘软件开发工程师笔试试题,选择题第七题)