mvsigatova
11.08.2020 15:44

Сапрограмувати кнопку ,,Підрахувати" var
Form1: TForm1;
a: array [0..14] of Integer;
k,num,i:integer;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.Button1Click(Sender: TOhject);
begin
num:=StrToln(Edit1.Text);
k=0;
for i:=0 to 14 do
begin
a[i]:=StrTolnt(Memo1.Lines[1];
if a[i]=num then k:=k+1;
end;
label2.Caption:=IntToStr(k)+' повторень';
end;
end.

Нажмите на рекламу ниже и сразу увидите ответ
↓
Популярные вопросы:
Ответ:
BlueEyesCatОоак
16.12.2022 10:00
ПЕРВАЯ ПРОГРАММА
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Factorial
{
    class Program
    {
       
        static void Main(string[] args)
        {
            string str = "";
            Console.WriteLine("Vvestu n:");
            str = Console.ReadLine();
            int n = Convert.ToInt32(str);
            Console.WriteLine(Enumerable.Range(1, n).Aggregate((p, x) => p * x));
            Console.ReadKey();
        }
    }
}

Вторая программа (поменяй путь на свой!)
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Open
{
    class Program
    {
        static void Main(string[] args)
        {
            System.Diagnostics.Process.Start(@"T:\Program Files\Projects\Lessons\Factorial\Factorial\bin\Debug\Factorial.exe");
        }
    }
}
0,0(0 оценок)
Ответ:
marat5230
20.02.2023 10:07
#include <iostream>
using namespace std;

int main()
{
int n, k;
cout << "n = ";
cin >> n;
cout << endl;
int a[n];
for (int i = 0; i < n; i++) {
cout << "a[" << i << "] = ";
cin >> a[i];
cout << endl;
}
cout << "k = ";
cin >> k;
cout << endl;
int c = 0;
for (int i = 0; i < n; i++) {
if (a[i] % 10 == k) c++;
}

int ret[c], pos = 0;
for (int i = 0; i < n; i++) {
if (a[i] % 10 == k) {
ret[pos] = a[i];
pos++;
}
}
cout << "Результат:" << endl;
for (int i = 0; i < c; i++) {
cout << ret[i] << ' ';
}
return 0;
}
0,0(0 оценок)
Полный доступ
Позволит учиться лучше и быстрее. Неограниченный доступ к базе и ответам от экспертов и ai-bota Оформи подписку
logo
Начни делиться знаниями
Вход Регистрация
Что ты хочешь узнать?
Спроси ai-бота