Объяснение:
отправляю только код (потому что файлы программы не воспринимаются), если нужна полная прога вместе с формочкой и тд, пишите
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace расчет_поездки_на_дачу
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
float.TryParse(textBox1.Text, out float s);
float.TryParse(textBox2.Text, out float price);
float.TryParse(textBox3.Text, out float consumption);
float Sum = s / 100 * price * consumption;
if (checkBox1.Checked == true)
{
Sum *= 2;
}
label4.Text = "Поездка на дачу и обратно обойдется в "+ Sum + "руб";
}
}
}
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <vector>
#include <algorithm>
using namespace std;
bool myfunction (int i,int j) { return (i>j); } // comparator
int main() {
srand(time(0));
int N;
cin >> N;
vector<int> A(N);
for(int i = 0; i<A.size(); ++i) {
A[i]=rand();
cout << A[i] << " ";
}
cout << endl;
sort(A.begin(), A.end(), myfunction);
for(int i = 0; i<A.size(); ++i) {
cout << A[i] << " ";
}
system("pause");
}
DACB - 11001001
Расставим степени числа 11001001 от нуля до 7 справа налево и получим в десятичной системе счисления
1*2^7 + 1*2^6 + 0*2^5 + 0*2^4 + 1*2^3 + 0*2^2 + 0*2^1 + 1*2^0 =128+64+8+1=201