#include <iostream>
#include <vector>
using namespace std;
void ins_sort(vector<int>& vec) {
for (int i = 1; i < vec.size(); i++) {
int j = i - 1;
int flag = 0;
int temp = vec[i];
while (j >= 0 && vec[j] > temp) {
vec[j + 1] = vec[j];
j--;
flag++;
}
vec[j + 1] = temp;
if (flag != 0) {
for (int i = 0; i < vec.size(); i++) {
cout << vec[i] << " ";
}
cout << endl;
}
}
}
signed main() {
int N;
cin >> N;
vector<int> vec(N);
for (int i = 0; i < N; i++)
cin >> vec[i];
ins_sort(vec);
return 0;
}
Движок не позволяет добавить архив с проектом
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApp3
{
class Program
{
public class client
{
public string FIO;
public string phone;
public string adress;
public client()
{
}
public client(string FIO, string phone, string adress)
{
this.FIO = FIO;
this.phone = phone;
this.adress = adress;
}
public client(client NewClient)
{
this.FIO = NewClient.FIO;
this.phone = NewClient.phone;
this.adress = NewClient.adress;
}
public string PoluchitInfo()
{
return "ФИО: " + this.FIO + "\nтелефон: " + this.phone + "\nадрес: " + this.adress;
}
}
public class customer: client
{
public double Trovar;
public int Kolichestvo;
public double Stoimost;
public customer()
{
}
public customer(customer NewCostumer)
{
this.FIO = NewCostumer.FIO;
this.phone = NewCostumer.phone;
this.adress = NewCostumer.adress;
this.Trovar = NewCostumer.Trovar;
this.Kolichestvo = NewCostumer.Kolichestvo;
this.Stoimost = NewCostumer.Stoimost;
}
public customer(string FIO, string phone, string adress, double Trovar, int Kolichestvo)
{
this.FIO = FIO;
this.phone = phone;
this.adress = adress;
this.Trovar = Trovar;
this.Kolichestvo = Kolichestvo;
this.SchitatStoimost();
}
public double SchitatStoimost()
{
return Stoimost = Trovar * Kolichestvo;
}
}
static void Main(string[] args)
{
customer[] customers = new customer[3];
customers[0] = new customer("Иванов", "322223322", "Бобруйск", 1.1, 2);
customers[1] = new customer("Петров", "123456789", "Урюпинск", 2.2, 5);
customers[2] = new customer("Сидоров", "987654321", "Крыжополь", 3.3, 10);
double Sum = 0;
foreach(customer Temp in customers)
{
Console.WriteLine(Temp.PoluchitInfo()+"\n");
Sum += Temp.Stoimost;
}
Console.WriteLine(Sum.ToString());
Console.ReadLine();
}
}
}
for i:=1 to 10 do begin
srzn:=m[i];
end;
srzn:=srzn/100;
end.