1 / 14

Практическое занятие 13

Циклы. Практическое занятие 13. Вычислить сумму ряда чисел. Задача 1. Program sum; var a: integer; s: real; Begin a:= 1 ; s:=0; while a< 6 00 do begin a:=a+ 1 ; s:=s+ 1/ a; end; writeln ( ' s = ' , s:5:3); end.

finn
Télécharger la présentation

Практическое занятие 13

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Циклы Практическое занятие 13

  2. Вычислить сумму ряда чисел Задача 1

  3. Program sum; var a: integer; s: real; Begin a:=1; s:=0; while a<600 do begin a:=a+1; s:=s+1/a; end; writeln ('s=',s:5:3); end. Решение задачи 1

  4. Задача 2 Вычислить сумму ряда чисел

  5. Program sum; var s :real; a, n: integer; Begin writeln (‘Введите n’); readln (n); a:=1; s:=0; while a< n do begin a:=a+1; if a mod 2=0 then s:=s+1/a else s:=s-1/a; end; writeln (‘сумма ряда равна s=‘,s:5:3); end. Решение задачи 2

  6. Дано число N. Вывести все делители этого числа. Задача 3

  7. var i,n:integer; begin writeln('Введите N'); readln(n); for i:=1 to n do if n mod i=0 then write(i:4); end. Решение задачи 3

  8. Напечатать в возрастающем порядке все трехзначные числа, в десятичной записи которых нет одинаковых цифр (операции деления и нахождения остатка от деления не использовать). Задача 4

  9. uses crt; var i, j, k: integer; begin for i:=1 to 9 do for j:=0 to 9 do begin for k:=0 to 9 do if (i<>j) and (i<>k) and (j<>k) then write(i*100+j*10+k, ' '); writeln; end; end. Решение задачи 4

  10. Составить алгоритм решения ребуса ДРУГ+ГУРД = 7777 (различные буквы обозначают различные цифры, старшая — не 0). Задача 5

  11. uses crt; var d, r, u, g: integer; begin for d:=2 to 9 do for r:=0 to 9 do for u:=0 to 9 do for g:=1 to 9 do if (d<>u) and (d<>r) and (d<>g) and (r<>u) and (r<>g) and (g<>u) and (d*1000+r*100+u*10+g+g*1000+u*100+r*10+d=7777)then write(d,r,u,g, ' '); end. Решение задачи 5

  12. ПРИДУМАТЬ РЕБУС И НАПИСАТЬ ПРОГРАММУ РЕШЕНИЯ ЭТОГО РЕБУСА. Задача 6

  13. Решение задачи 6

  14. Составить алгоритм решения ребуса КОТ+ТОК = ААА (различные буквы обозначают различные цифры, старшая — не 0). Домашнее задание

More Related