Program pryam;
Var y1, y2, y3, x1, x2 : real;
Begin
writeln ('Введите координату (у) верхней точки прямой');
readln (y1);
writeln ('Введите координату (у) нижней точки прямой');
readln (y2);
writeln ('Введите координату (х) точек-концов прямой');
readln (x1);
writeln ('Введите координату (у) точки, принадлежность к прямой которой нужно определить');
readln (y3);
writeln ('Введите координату (х) точки, принадлежность к прямой которой нужно определить');
readln (x2);
if (y3<=y1) and (y3>=y2) and (x2=x1) then writeln (' принадлежит ')
else writeln (' не принадлежит ');
readln;
End.
#include "stdafx.h"
#include <stdio.h>//i/o
#include <conio.h> //_getch()
#include <ctype.h> //toupper
int main()
{
long i,n;
float cost, p,buf;
do
printf("Vvedite pervonachalnuy stoimost : ");scanf_s("%f",&cost);
printf("Vvedite procent p % : ");scanf_s("%f",&p);
printf("Vvedite n chisl Let : ");scanf_s("%u",&n);
for(i = 0; i < n; i++)
printf("Let %u\r\n",i + 1);
buf = cost*p/100;
printf("Stoimost za zimmu + : %f\r\n",(cost += buf));
printf("Stoimost za zimmu -: %f\r\n",(cost -= buf));
}
printf("Stoimost %u Let %f\r\n",i,cost);
printf("Najmite Y - new input\r\n");
while(toupper(_getch()) == 'Y');
return 0;
Program pryam;
Var y1, y2, y3, x1, x2 : real;
Begin
writeln ('Введите координату (у) верхней точки прямой');
readln (y1);
writeln ('Введите координату (у) нижней точки прямой');
readln (y2);
writeln ('Введите координату (х) точек-концов прямой');
readln (x1);
writeln ('Введите координату (у) точки, принадлежность к прямой которой нужно определить');
readln (y3);
writeln ('Введите координату (х) точки, принадлежность к прямой которой нужно определить');
readln (x2);
if (y3<=y1) and (y3>=y2) and (x2=x1) then writeln (' принадлежит ')
else writeln (' не принадлежит ');
readln;
End.
#include "stdafx.h"
#include <stdio.h>//i/o
#include <conio.h> //_getch()
#include <ctype.h> //toupper
int main()
{
long i,n;
float cost, p,buf;
do
{
printf("Vvedite pervonachalnuy stoimost : ");scanf_s("%f",&cost);
printf("Vvedite procent p % : ");scanf_s("%f",&p);
printf("Vvedite n chisl Let : ");scanf_s("%u",&n);
for(i = 0; i < n; i++)
{
printf("Let %u\r\n",i + 1);
buf = cost*p/100;
printf("Stoimost za zimmu + : %f\r\n",(cost += buf));
buf = cost*p/100;
printf("Stoimost za zimmu -: %f\r\n",(cost -= buf));
}
printf("Stoimost %u Let %f\r\n",i,cost);
printf("Najmite Y - new input\r\n");
}
while(toupper(_getch()) == 'Y');
return 0;
}