Uchenik00ot00boga
04.08.2020 18:34

Заданы 270 целых чисел. посчитать количество чисел больше 10 и количество чисел меньше -5 решить на языке бейсик и на языке си

Нажмите на рекламу ниже и сразу увидите ответ
Популярные вопросы:
Ответ:
Shkola17032004
27.01.2021 17:44
С++

#include <iostream>using namespace std;
int main(){ int arr[20]; // Сколько хочешь, столько и ставь // Заполни как хочешь int score = 0; for (int i = 0; i < 20; i++){ if (arr[i] < 13){ score++; }; };}

JAVA

import java.util.*;
import java.lang.*;

class {
public static void main(String[] args){

Scanner sc = new Scanner(System.in); // то для ввода

int arr[] = new int[20]; // Сколько хочешь, столько и ставь
// Заполни как хочешь
int score = 0;
for (int i = 0; i < 20; i++){if (arr[i] < 13){score++;};
}
}
0,0(0 оценок)
Ответ:
monster19977s2
13.02.2022 17:28
#include <stdio.h>#include <stdlib.h>#include <conio.h>
/* main program fucntion */void main(){  int     iMatrSize, // size of the matrix    iSum = 0,  // sum of the nessesary elements of the matrix    iCnt = 0,  // number of the nessesary elements of the matrix    **aMatr;   // the matrix  int i, j;
  scanf_s("%i", &iMatrSize);
  /* allocation memory for the array */  aMatr = (int**)malloc(sizeof(int) * iMatrSize);  for (i = 0; i < iMatrSize; i++)  {    aMatr[i] = (int*)malloc(sizeof(int) * iMatrSize);  }
  /* filling in the array */  for (i = 0; i < iMatrSize; i++)    for (j = 0; j < iMatrSize; j++)      aMatr[i][j] = rand() % 21 - 10;
  /* counting the sum of the elements */  for (i = 0; i < iMatrSize; i++)    for (j = 0; j < iMatrSize - i - 1; j++)      iSum += aMatr[i][j], iCnt++;
  /* outputing the array */  for (i = 0; i < iMatrSize; i++)  {    for (j = 0; j < iMatrSize; j++)      printf ("%3i ", aMatr[i][j]);    printf("\n");  }
  printf("Sum = %f\n", (float)iSum / iCnt);
  _getch();} /* End of 'main' function */
0,0(0 оценок)
Полный доступ
Позволит учиться лучше и быстрее. Неограниченный доступ к базе и ответам от экспертов и ai-bota Оформи подписку
logo
Начни делиться знаниями
Вход Регистрация
Что ты хочешь узнать?
Спроси ai-бота