This commit is contained in:
Andrew 2019-11-18 10:01:42 +07:00
commit 2802401eee
79 changed files with 2650 additions and 0 deletions

View file

@ -0,0 +1,13 @@
// pb_z1_1.cpp
// Горбацевич Андрей
#include <stdio.h>
#include <algorithm>
using namespace std;
int main() {
int a, b;
printf("a b >>>");
scanf("%d %d", &a, &b);
swap(a, b);
printf("a=%d \nb=%d", a, b);
}

View file

@ -0,0 +1,15 @@
// pb_z1_2.cpp
// Горбацевич Андрей
#include <stdio.h>
using namespace std;
int main() {
int num_people, num_seats, num_buses, num_free_seats;
printf("People count seats count >>>");
scanf("%d %d", &num_people, &num_seats);
num_buses = num_people / num_seats;
bool additional_seats = num_people % num_seats > 0;
num_buses += additional_seats;
num_free_seats = num_buses * num_seats - num_people;
printf("Busses count: %d\nFree seats: %d\n", num_buses, num_free_seats);
}

View file

@ -0,0 +1,14 @@
// pb_z1_3.cpp
// Горбацевич Андрей
#include <stdio.h>
#include <cmath>
#include <algorithm>
using namespace std;
int main() {
double d;
printf("d >>>");
scanf("%lf", &d);
d = ((int)(abs(d) * 10)) % 10;
printf("%d", (int)d);
}