Tin học Hãy mô tả thuật toán tính T=1+1/2+-+1/n 30/07/2021 By Iris Hãy mô tả thuật toán tính T=1+1/2+….+1/n
*Mô tả thuật toán: Bước 1: Nhập N Bước 2: t ← 0; Bước 3: i ← 1 to n do t ← t+1/i; Bước 4: Xuất T ra màn hình và kết thúc thuật toán Trả lời
thuật toán: Bước 1: Nhập N Bước 2: Gán T bằng 0; (t:=0) Bước 3: Chạy vòng lặp từ i:=1 cho đến cộng 1/i (for i:=1 to n do t:=t+1/i); Bước 4: In T màn hình Trả lời
*Mô tả thuật toán:
Bước 1: Nhập N
Bước 2: t ← 0;
Bước 3: i ← 1 to n do t ← t+1/i;
Bước 4: Xuất T ra màn hình và kết thúc thuật toán
thuật toán:
Bước 1: Nhập N
Bước 2: Gán T bằng 0; (t:=0)
Bước 3: Chạy vòng lặp từ i:=1 cho đến cộng 1/i (for i:=1 to n do t:=t+1/i);
Bước 4: In T màn hình