mirror of
https://github.com/ada-dmitry/prog.l_ada.git
synced 2026-09-24 01:00:15 +00:00
one
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
/DZ.c
|
||||
/output
|
||||
/.vscode
|
||||
@@ -0,0 +1,49 @@
|
||||
#include <stdio.h>
|
||||
#define N 5
|
||||
void sort_Select(int x, int *arr){
|
||||
int ind, temp = 0;
|
||||
int i,j;
|
||||
for(i=0;i<(x-1);i++){
|
||||
ind = i;
|
||||
for(j=i+1;j<x;j++){
|
||||
if(arr[ind]>arr[j]){
|
||||
ind = j;
|
||||
}
|
||||
}
|
||||
temp = arr[i];
|
||||
arr[i] = arr[ind];
|
||||
arr[ind] = temp;
|
||||
}
|
||||
|
||||
}
|
||||
void sort_insert(int l, int *arr){
|
||||
int i, j, x;
|
||||
for(i=0;i<l;i++){
|
||||
j = i-1;
|
||||
x = arr[i];
|
||||
while((arr[j]>x)&&(j>=0)){
|
||||
arr[j+1] = arr[j];
|
||||
j--;
|
||||
arr[j+1] = x;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
int main(int argc, char** argv) {
|
||||
int l,i;
|
||||
//printf("Vvedite razmer massiva: ");
|
||||
//scanf("%d", l);
|
||||
int arr[N] = {4,5,2,3,1};
|
||||
int arra[N] = {3,5,2,4,1};
|
||||
sort_Select(N, arr);
|
||||
sort_insert(N, arra);
|
||||
for(i=0;i<N;i++){
|
||||
printf("%d", arr[i]);
|
||||
}
|
||||
printf("\n");
|
||||
for(i=0;i<N;i++){
|
||||
printf("%d", arra[i]);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
'''
|
||||
print("Введите размер массива: ")
|
||||
n = int(input())
|
||||
a = [int(input()) for i in range(n)]
|
||||
'''
|
||||
a = [4,3,2,5,1]
|
||||
b = a.copy()
|
||||
def sortSelect(arr):
|
||||
for i in range(len(arr)-1):
|
||||
ind = i
|
||||
for j in range(i+1, len(arr)):
|
||||
if(arr[ind]>arr[j]):
|
||||
ind = j
|
||||
arr[i], arr[ind] = arr[ind], arr[i]
|
||||
return arr
|
||||
|
||||
|
||||
def sortInsert(arr):
|
||||
for i in range(len(arr)):
|
||||
j = i-1
|
||||
x = arr[i]
|
||||
while((arr[j]>x)and(j>=0)):
|
||||
arr[j+1] = arr[j]
|
||||
j -= 1
|
||||
arr[j+1] = x
|
||||
return arr
|
||||
|
||||
|
||||
|
||||
print(sortSelect(a), sortInsert(b))
|
||||
@@ -0,0 +1,40 @@
|
||||
|
||||
#Вариант с пары
|
||||
'''
|
||||
from bs4 import BeautifulSoup
|
||||
from selenium import webdriver
|
||||
from selenium.webdriver.chrome.service import Service
|
||||
import time
|
||||
|
||||
S = Service('D:\teach\Prog\chromedriver.exe') #Открыли драйвер для хрома
|
||||
browser = webdriver.Chrome(service=S) #Инициировали в отдельную переменную
|
||||
browser.get('https://www.kinopoisk.ru/lists/movies/top250/')
|
||||
html_text = browser.page_source
|
||||
time.sleep(20)
|
||||
soup = BeautifulSoup(html_text, 'lxml')
|
||||
films = soup.find_all('div', class_='base-movie-main-info_mainInfo__ZL_u3')
|
||||
|
||||
print(soup)
|
||||
print(films)
|
||||
|
||||
for film in films:
|
||||
print(film.text)
|
||||
'''
|
||||
#Домашка
|
||||
|
||||
from bs4 import BeautifulSoup
|
||||
from selenium import webdriver
|
||||
from selenium.webdriver.chrome.service import Service
|
||||
|
||||
driver = Service('D:\teach\Prog\chromedriver.exe')
|
||||
browser = webdriver.Chrome(service=driver)
|
||||
browser.get('https://hmbrussia.ru/regional-office/')
|
||||
html_code = browser.page_source
|
||||
b_soup = BeautifulSoup(html_code, 'lxml')
|
||||
name = b_soup.find_all('div', class_="ps-xl-3 ms-xl-3")
|
||||
|
||||
print(b_soup)
|
||||
print(name)
|
||||
|
||||
for i in name:
|
||||
print(i.text)
|
||||
Reference in New Issue
Block a user