М
Молодежь
К
Компьютеры-и-электроника
Д
Дом-и-сад
С
Стиль-и-уход-за-собой
П
Праздники-и-традиции
Т
Транспорт
П
Путешествия
С
Семейная-жизнь
Ф
Философия-и-религия
Б
Без категории
М
Мир-работы
Х
Хобби-и-рукоделие
И
Искусство-и-развлечения
В
Взаимоотношения
З
Здоровье
К
Кулинария-и-гостеприимство
Ф
Финансы-и-бизнес
П
Питомцы-и-животные
О
Образование
О
Образование-и-коммуникации
lesikviktoria47
lesikviktoria47
06.05.2023 14:55 •  Информатика

Напишите программы в паскале: 1) цикл с предусловием. написать программу, вычисления у=х2 при х=2, 4, 6, 8, 10; 2) цикл с постусловием. написать программу, в которой требуется вводить с клавиатуры числа и подсчитывать их сумму, до первого введенного отрицательного числа; 3) цикл параметром. написать программу, которая находит сумму чисел от 1 до 20

👇
Ответ:
konoki1982
konoki1982
06.05.2023
Program n1;
var y, x: integer;
begin
x:=0;
while x<10 do begin
x:=x+2;
y:=x*x;
writeln(y);
end;
end.

Program n2;
var x, sum: real;
begin
sum:=0;
repeat
readln(x);
if(x>=0) then sum:=sum+x;
until x<0;
writeln(sum);
end.

Program n3;
var a, i: integer;
begin
a:=0;
for i:=1 to 20 do a:=a+i;
writeln(a);
end.
4,4(91 оценок)
Открыть все ответы
Ответ:
ЗАЙКА200515
ЗАЙКА200515
06.05.2023

import java.util.Scanner;

public class Main {

  static int col=0;

   public static void main(String[] args) {

       Container c1 =new Container(10,4,2.5);

       v2(c1);

       System.out.println(col);

   }

   static void v2(Container container) {

       System.out.println("Ведите размеры авто");

       Scanner scanner = new Scanner(System.in);

       double l= scanner.nextInt();

       double h=scanner.nextInt();;

       double w=scanner.nextInt();;

       Car car = new Car(l,h,w);

       if (container.hashCode() >= car.hashCode()) {

           container.widht = container.widht - car.widht;

           container.height= container.height - car.height;

           container.leng = container.leng - car.leng;

            col++;

            v2(container);

           }

   }

}

public class Car {

    final double leng;

    final double height;

    final double widht;

   Car(double leng,double height,double widht){

       this.leng=leng;

       this.height=height;

       this.widht=widht;

   }

   @Override

   public int hashCode() {

       return (int) (leng+height+widht);

   }

}

public class Container {

    static double leng;

    static double height;

    static double widht;

   Container(double leng,double height,double widht){

       this.leng=leng;

       this.height=height;

       this.widht=widht;

   }

   @Override

   public int hashCode() {

       return (int) (leng+height+widht);

   }

}

4,5(72 оценок)
Ответ:
Verabogomaz
Verabogomaz
06.05.2023
var a, b: integer;
begin
 writeln('Введите часы: ');
 readln(a);
 writeln('Введите минуты: ');
 readln(b);
if (a > 6) and (a < 10) then writeln('Утро');
if (a = 10) and (b = 0) then writeln('Утро');
if (a = 6) and (b >= 30) then writeln('Утро');
if (a > 10) and (a < 16) then writeln('День');
if (a = 10) and (b >= 1) then writeln('День');
if (a = 16) and (b <= 30) then writeln('День');
if (a > 16) and (a < 22) then writeln('Вечер');
if (a = 22) and (b = 0) then writeln('Вечер');
if (a = 16) and (b >= 31) then writeln('Вечер');
if (a > 22) or (a < 6) then writeln('Ночь');
if (a = 22) and (b >= 1) then writeln('Ночь');
if (a = 6) and (b <= 30) then writeln('Ночь');
end.
4,5(70 оценок)
Новые ответы от MOGZ: Информатика
logo
Вход Регистрация
Что ты хочешь узнать?
Спроси Mozg
Открыть лучший ответ