Created
October 10, 2012 18:20
-
-
Save vertrigo/3867464 to your computer and use it in GitHub Desktop.
ну надо ж теперь и себе лабу сделать
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Program lab8; | |
| uses crt; | |
| var f:text; | |
| x,y,sy:real; | |
| n:integer; | |
| begin | |
| clrscr; | |
| assign(f,'coor.txt'); | |
| rewrite(f); | |
| writeln('Введите в файл координаты точек, окончание ввода х=0 и у=0:'); | |
| repeat | |
| write('x: ');readln(x); | |
| write(f,' ',x:0:2); | |
| write('y: ');readln(y); | |
| write(f,' ',y:0:2); | |
| until(x=0) and (y=0); | |
| close(f); | |
| clrscr; | |
| reset(f); | |
| n:=0;sy:=0; | |
| writeln('Содержание файла:'); | |
| while not eof(f) do | |
| begin | |
| n:=n+1; | |
| read(f,x); | |
| read(f,y); | |
| sy:=sy+y; | |
| writeln(x:0:2,' ',y:0:2); | |
| end; | |
| writeln; | |
| write('Среднее отклонение от оси ОХ: ',sy/n:0:2); | |
| close(f); | |
| Readkey; | |
| end. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment