mirror of
https://github.com/ada-dmitry/TMP_C712.git
synced 2026-09-24 09:10:16 +00:00
added more task
This commit is contained in:
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
#include <stdio.h>
|
||||
|
||||
float fahr(int cel)
|
||||
{
|
||||
float res;
|
||||
|
||||
res = cel * 9 / 5 + 32;
|
||||
|
||||
return res;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
#include <stdio.h>
|
||||
#include "func.c"
|
||||
|
||||
float fahr(int cel);
|
||||
|
||||
int main()
|
||||
{
|
||||
int cel; // градусы Цельсия
|
||||
float f; // градусы Фаренгейта
|
||||
|
||||
scanf("%d", &cel);
|
||||
f = fahr(cel);
|
||||
printf("%.2f\n", f); // .2f - печатать с точностью до 2 знаков после .
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user