Python:
class book:
def __init__(self, author, name, date):
self.author = author
self.name = name
self.date = date
def print(self):
print(self.name, self.author, self.date)
book1 = book("абоба", "математика 8 класс", 1951)
book2 = book("абоба", "информатика 8 класс", 1992)
book3 = book("абоба", "математика 10 класс", 1991)
book4 = book("абоба1", "математика 10 класс", 1994)
book5 = book("абоба1", "информатика 10 класс", 1955)
book6 = book("абоба1", "информатика 11 класс", 1993)
book7 = book("абоба", "физика 8 класс", 1952)
book8 = book("абоба", "информатика 8 класс", 1871)
book9 = book("абоба1", "физика 8 класс", 1951)
book10 = book("абоба1", "физика 8 класс", 1971)
library = [book1, book2, book3, book4, book5, book6, book7, book8, book9, book10]
# a
author = "абоба" # автор, книги которого ищем
print("а)")
for i in range(len(library)):
if library[i].author == author and library[i].date >= 1960:
print(library[i].name)
# б
print("б)")
for k in library[i].name.split():
if k == 'информатика':
library[i].print()
# в
print("в)")
for i in range(len(library) - 1):
for j in range(i + 1, len(library)):
if library[i].author == library[j].author and library[i].name == library[j].name:
library[j].print()
#include <iostream>
#include <vector>
using namespace std;
void solve1(){
const int N = 7, X = 6;
int cnt = 0;
vector<int> a(N);
for(auto &i: a) cin >> i;
for(auto &i: a) cnt += (i > X);
cout << cnt;
}
void solve2(){
const int N = 12;
int res = 1;
vector<int> p(N);
for(auto &i: p) cin >> i;
for(auto &i: p)
if(!(i & 1))
res *= i;
(res == 1) ? cout << 0 : cout << res;
void solve3(){
const int N = 17;
int x, ans = 0;
vector<int> t(N);
for(auto &i: t) cin >> i;
cin >> x;
while(++x < N)
ans += t[x];
cout << ans;
int main(){
//solve1(); //task1
//solve2(); //task2
//solve3(); //task3
Python:
class book:
def __init__(self, author, name, date):
self.author = author
self.name = name
self.date = date
def print(self):
print(self.name, self.author, self.date)
book1 = book("абоба", "математика 8 класс", 1951)
book2 = book("абоба", "информатика 8 класс", 1992)
book3 = book("абоба", "математика 10 класс", 1991)
book4 = book("абоба1", "математика 10 класс", 1994)
book5 = book("абоба1", "информатика 10 класс", 1955)
book6 = book("абоба1", "информатика 11 класс", 1993)
book7 = book("абоба", "физика 8 класс", 1952)
book8 = book("абоба", "информатика 8 класс", 1871)
book9 = book("абоба1", "физика 8 класс", 1951)
book10 = book("абоба1", "физика 8 класс", 1971)
library = [book1, book2, book3, book4, book5, book6, book7, book8, book9, book10]
# a
author = "абоба" # автор, книги которого ищем
print("а)")
for i in range(len(library)):
if library[i].author == author and library[i].date >= 1960:
print(library[i].name)
# б
print("б)")
for i in range(len(library)):
for k in library[i].name.split():
if k == 'информатика':
library[i].print()
# в
print("в)")
for i in range(len(library) - 1):
for j in range(i + 1, len(library)):
if library[i].author == library[j].author and library[i].name == library[j].name:
library[i].print()
library[j].print()
#include <iostream>
#include <vector>
using namespace std;
void solve1(){
const int N = 7, X = 6;
int cnt = 0;
vector<int> a(N);
for(auto &i: a) cin >> i;
for(auto &i: a) cnt += (i > X);
cout << cnt;
}
void solve2(){
const int N = 12;
int res = 1;
vector<int> p(N);
for(auto &i: p) cin >> i;
for(auto &i: p)
if(!(i & 1))
res *= i;
(res == 1) ? cout << 0 : cout << res;
}
void solve3(){
const int N = 17;
int x, ans = 0;
vector<int> t(N);
for(auto &i: t) cin >> i;
cin >> x;
while(++x < N)
ans += t[x];
cout << ans;
}
int main(){
//solve1(); //task1
//solve2(); //task2
//solve3(); //task3
}