Nar43
17.04.2021 22:33

Разработайте скрипт с анимацией и событиями используя костюмы и сцены. Ребята

Нажмите на рекламу ниже и сразу увидите ответ
Популярные вопросы:
Ответ:
diankapazyukа
25.12.2020 02:47

Решение Pascal

Delphi/Pascal

program Case5;

var

 N,A,B:Integer;

begin

 Write('Введите номер действия: ');

 Readln(N);

 Write('Введите число A: ');

 Readln(A);

 Write('Введите число B: ');

 Readln(B);

 

 Case N of

   1: Writeln(A+B);

   2: Writeln(A-B);

   3: Writeln(A*B);

   4: Writeln(A/B);

 end;

end.

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

program Case5;

var

 N,A,B:Integer;

begin

 Write('Введите номер действия: ');

 Readln(N);

 Write('Введите число A: ');

 Readln(A);

 Write('Введите число B: ');

 Readln(B);

 

 Case N of

   1: Writeln(A+B);

   2: Writeln(A-B);

   3: Writeln(A*B);

   4: Writeln(A/B);

 end;

end.

 

Решение C

C

#include <stdio.h>

 

int main(void)

{

  system("chcp 1251");

  int n;

  float a,b;

  printf("N:") ;

  scanf ("%i", &n);

  printf("A:") ;

  scanf ("%f", &a);

  printf("B:") ;

  scanf ("%f", &b);

 

  switch (n) {

  case 1:

      printf("%f\n",a+b) ;

      break;

  case 2:

      printf("%f\n",a-b) ;

      break;

  case 3:

      printf("%f\n",a*b) ;

      break;

  case 4:

      printf("%f\n",a/b) ;

      break;

  }

  return 0;

}

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

#include <stdio.h>

 

int main(void)

{

  system("chcp 1251");

  int n;

  float a,b;

  printf("N:") ;

  scanf ("%i", &n);

  printf("A:") ;

  scanf ("%f", &a);

  printf("B:") ;

  scanf ("%f", &b);

 

  switch (n) {

  case 1:

      printf("%f\n",a+b) ;

      break;

  case 2:

      printf("%f\n",a-b) ;

      break;

  case 3:

      printf("%f\n",a*b) ;

      break;

  case 4:

      printf("%f\n",a/b) ;

      break;

  }

  return 0;

}

Объяснение:

0,0(0 оценок)
Ответ:
nastyarybinskap0ai9q
28.08.2022 18:46

//С циклом for:

import java.util.Scanner;

import java.util.Arrays; //Если захочется напечатать в консоль массив

public class MyClass {

   public static void main(String args[]) {

       Scanner input = new Scanner(System.in);

       String[] numbers = input.nextLine().split(" "); /split() делит значения после определённого символа, в нашем случае — пробела

       int sum = 0;

   

       for(int i = 0; i<numbers.length; i++) {

           sum += Integer.parseInt(numbers[i]);

       }

       System.out.println("The sum of the numbers: " + sum);

       //System.out.println(Arrays.toString(numbers));

   }

}

//С циклом while:

import java.util.Scanner;

import java.util.Arrays;

public class MyClass {

   public static void main(String args[]) {

       Scanner input = new Scanner(System.in);

       String[] numbers = input.nextLine().split(" ");

       int sum = 0;

       int i = 0;

 

       while(numbers.length != i) {

              sum += Integer.parseInt(numbers[i]);

              i++;

       }

       System.out.println("The sum of the numbers: " + sum);

       //System.out.println(Arrays.toString(numbers));

   }

}

//С циклом do-while:

import java.util.Scanner;

import java.util.Arrays;

public class MyClass {

   public static void main(String args[]) {

       Scanner input = new Scanner(System.in);

       String[] numbers = input.nextLine().split(" ");

       int sum = 0;

       int i = 0;

       

       do {

           sum += Integer.parseInt(numbers[i]);

           i++;

       } while(numbers.length != i);

       

       System.out.println("The sum of the numbers: " + sum);

       //System.out.println(Arrays.toString(numbers));

   }

}

0,0(0 оценок)
Полный доступ
Позволит учиться лучше и быстрее. Неограниченный доступ к базе и ответам от экспертов и ai-bota Оформи подписку
logo
Начни делиться знаниями
Вход Регистрация
Что ты хочешь узнать?
Спроси ai-бота