S
🚨 29 мая стартует курс «Пентест Active Directory: от теории к практике» от Академии Кодебай
🔍 Изучите реальные техники атак на инфраструктуру Active Directory: от первоначального доступа до полной компрометации.
🛠️ Освойте инструменты, такие как BloodHound, Mimikatz, CrackMapExec и другие.
🧪 Пройдите практические лабораторные работы, имитирующие реальные сценарии атак.
🧠 Получите знания, которые помогут вам стать востребованным специалистом в области информационной безопасности.После старта курса запись открыта еще 10 дней Подробнее о курсе ...
омг, зачем так извращаться?Код:if ( ((int)(i/2))==((double)(i)/2) )
if(!(i%2))
#include "stdafx.h"
#include <iostream>
#include <math.h>
using namespace std;
template <class Q>
void merge_sort(Q a[], int lb, int ub){
poisk(a,lb,ub);
}
template <class Q>
void slian(Q a[], int lb, int l, int ub, int r, int w) {
Q *t = new Q[ub-lb+1];
if(w%2==0){
for (int lt=0, i=lb, j=ub; i<=l || j>=r;lt++){
if(i<=l && j>=r){
if(a[i]<a[j]){
t[lt]=a[i];
i++;
}
else{
t[lt]=a[j];
j++;
}
}
if(i<=l && j<r){
t[lt]=a[i];
i++;
}
if(j>=r && i>l){
t[lt]=a[j];
j++;
}
}
}
}
template <class Q>
void poisk(Q a[], int lb, int ub){
int w=0;
int l=lb;
int r=ub;
for (int c=0;(l+1)!=r;){
for (int i=l; i<r; i++){
if(a[i]<a[i+1]){
l=i;
}
else
break;
}
for (int j=r; l<j; --j){
if(a[j]<a[j-1]){
r=j;
}
else
break;
}
slian (a, lb, l, ub, r, w);
w+=1;
lb=l+1;
ub=r-1;
}
}
int _tmain(int argc, _TCHAR* argv[])
{
int c[16]={503, 87, 512, 61, 908, 170, 897, 275, 653, 426, 154, 509, 612, 677, 765, 703};
for (int i=0; i<16; i++)
cout<<c[i]<<",";
cout<<endl;
merge_sort (c, 0, 15);
for (int i=0; i<16; i++)
cout<<c[i]<<",";
cout<<endl;
return 0;
}
#include<iostream.h>
#include<math.h>
#include<fstream.h>
#include<conio.h>
#include<iomanip.h>
#include<string.h>
const int L=51;
struct fio
{char fam[L],im[L],ot[L];
};
struct avto
{fio f;
char mar[L];
char str[L];
char gv[L];
};
struct otvet
{fio f;
char mar[L];
char str[L];
char gv[L];
int ng;
};
void inputfile(avto x[], int &n);
void outputs(otvet x[], int n);
void outputitog(otvet x, int n);
void outputfile(otvet x[], int n);
void inputfile(avto x[], int &n)
{ifstream fin;
char file[L];
cout<<"Imya vhodnogo faila:";
cin>>file;
fin.open(file);
if(fin.fail()){cout<<file<<" ne otkrivaetsya!";
getch(); exit(1);}
n=0;
do {fin>>x[n].f.fam>>x[n].f.im>>x[n].f.ot>>x[n].mar>>x[n].gv>>x[n].str;
n++;}
while (fin.good()); n--; fin.close();}
void outputfile(otvet x[], int n)
{ofstream fout;
char file[L]; int i;
cout<<"imya vihodnogo fayla:";
cin>>file;
fout.open(file);
if (!fout){cout<<file<<" ne sozdan"; getch(); exit(1); }
for(i=0;i<n;i++)
fout<<i+1<<setw(5)<<x[i].f.fam<<setw(5)<<x[i].f.im<<setw(5)<<x[i].f.ot<<setw(5)<<x[i].mar<<endl;
fout.close();
}
void outputs(otvet x[],int n)
{int i;
for(i=0;i<n;i++)
cout<<endl<<i+1<<setw(5)<<x[i].f.fam<<setw(5)<<x[i].f.im<<
setw(5)<<x[i].f.ot<<setw(5)<<x[i].mar<<setw(5)<<x[i].gv<<setw(5)<<x[i].str<<endl;
}
void main()
{const int N=100;
avto a[N];
otvet b[N];
int m,k,i,j,fl;
char max[N];
cout<<endl<<endl;
inputfile(a,m);
k=0;
for(i=0;i<m;i++)
{fl=0;
for(j=0;j<k;j++)
if(strcmp(a[i].mar,b[j].mar)==0)
{fl=1;b[j].ng++;break;}
if(fl==0){strcpy(b[k].f.fam,a[i].f.fam); strcpy(b[k].f.im,a[i].f.im);
strcpy(b[k].f.ot,a[i].f.ot); strcpy(b[k].mar,a[i].mar);b[k].ng=1;
k++;}
}
outputfile(b,k);
cout<<endl<<endl<<"Perechen`:\n";
outputs(b,k);
getch();
}
Заменить все отрицательные елементы на значение минимального положительного елемента,что не равен нулю.
Размерность массива - 50
Диапазон значений: от -100 до 100
int array[50]; // предпологается что уже заполнен!!
int i, min = 100;
for ( i = 0; i < 50; i++ ) if ( array[i] > 0 && array[i] < min ) min = array[i];
for ( i = 0; i < 50; i++ ) if ( array[i] < 0 ) array[i] = min;
# include <stdio.h>
# include <stdlib.h>
void main(void)
{
char symbol='a'; // буква, которую ищем
char str[80]="the C is exellent language"; // Это твой текст в котором искать надо
int count=0;
int i=0;
while (str[i]!='\0')
{
if (str[i]==symbol) count++; // перебираем буквы на соотвествие искомому символу
i++; // Нарасчиваем индекс
}
printf("You have %d \"%c\" in your text\n", count, symbol); // Выводим результат (типа че получилось)
}
Обучение наступательной кибербезопасности в игровой форме. Начать игру!