added more task

This commit is contained in:
ada-dmitry
2023-11-15 10:34:29 +03:00
parent 2a3484ba88
commit 10b256c812
14 changed files with 126 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
#include <stdio.h>
#include <stdlib.h>
int main()
{
int n1, n2;
float k;
scanf("%d%f", &n1, &k);
n2 = k * n1;
printf("%d\n", abs(n2 - n1));
return 0;
}
+16
View File
@@ -0,0 +1,16 @@
#include <stdio.h>
#define x 106
int main()
{
int rub, kop, rest, n;
scanf("%d%d", &rub, &kop);
n = (rub * 100 + kop) / x;
rest = (rub * 100 + kop) - n * x;
printf("%d %d\n", n, rest);
return 0;
}
+14
View File
@@ -0,0 +1,14 @@
#include <stdio.h>
int main()
{
int day, n, ans;
scanf("%d%d", &n, &day);
ans = (n - day) / 7 + 1;
printf("%d\n", ans);
return 0;
}
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
+18
View File
@@ -0,0 +1,18 @@
#include <stdio.h>
int main()
{
int g1, g2, k1, k2, s1, s2, g, s, k, sum;
scanf("%d%d%d", &g1, &s1, &k1);
scanf("%d%d%d", &g2, &s2, &k2);
sum = (g1 + g2) * 17 * 29 + (s1 + s2) * 29 + (k1 + k2);
g = sum / (17 * 29);
s = (sum - g * (17 * 29)) / 29;
k = sum - g * (17 * 29) - s * 29;
printf("%d %d %d\n", g, s, k);
return 0;
}
+14
View File
@@ -0,0 +1,14 @@
#include <stdio.h>
int main()
{
int Bell, nBell;
scanf("%d%d", &Bell, &nBell);
int sum_arifm_seq = (Bell + nBell) * (nBell - Bell + 1) / 2;
printf("%d\n", sum_arifm_seq);
return 0;
}