Statistica
All
RANK
199.399
of 300.369
REPUTAZIONE
0
CONTRIBUTI
0 Domande
1 Risposta
ACCETTAZIONE DELLE RISPOSTE
0.00%
VOTI RICEVUTI
0
CONTRIBUTI
0 Post
CONTRIBUTI
0 Pubblico Canali
VALUTAZIONE MEDIA
CONTRIBUTI
0 Punti principali
NUMERO MEDIO DI LIKE
Feeds
Risposto
Write a function called one_per_n that returns the smallest positive integer n for which the sum 1 + 1/2 + 1/3 + … + 1/n , is greater than or equal to x where x is the input argument. Limit the maximum number n of terms in the sum to 10,000 .
function out = one_per_n(x) total=0; n = 1; while total < x total = (total+1/n); n = n+1; end if n-1 > 1...
Write a function called one_per_n that returns the smallest positive integer n for which the sum 1 + 1/2 + 1/3 + … + 1/n , is greater than or equal to x where x is the input argument. Limit the maximum number n of terms in the sum to 10,000 .
function out = one_per_n(x) total=0; n = 1; while total < x total = (total+1/n); n = n+1; end if n-1 > 1...
oltre 10 anni fa | 0

