boris-vlasenko

1

Jan 16th, 2016
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.54 KB | None | 0 0
  1. var
  2.   n, i, k, m: integer;
  3.   x,s, a: real;
  4.  
  5. begin
  6.   // 2*1/5  4/5  6/5  2*i/5
  7.   //--1---
  8.   readln(n);
  9.   for i := 1 to n do
  10.   begin
  11.     x := (2 * i / 5);
  12.     writeln(x);
  13.   end;
  14.  
  15.   //---2----
  16.   readln(a);
  17.   i := 1;
  18.   x := (2 * i / 5);
  19.   s := 0;
  20.   while x < a do
  21.   begin
  22.     writeln(x);
  23.     s := s + x;
  24.     i := i + 1;
  25.     x := (2 * i / 5);
  26.   end;
  27.   writeln(s);
  28.   //---3-----
  29.   readln(a);
  30.   i := 1;
  31.   x := (2 * i / 5);
  32.   while x <= a do
  33.   begin
  34.     i := i + 1;
  35.     x := (2 * i / 5);
  36.   end;
  37.   writeln(x);
  38.  
  39.  
  40. end.
Advertisement
Add Comment
Please, Sign In to add comment