generated from admin/template
add repository c
This commit is contained in:
@@ -0,0 +1,13 @@
|
|||||||
|
/* Type your code here, or load an example. */
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <assert.h>
|
||||||
|
int main(void) {
|
||||||
|
int a = 26;
|
||||||
|
int b = 5;
|
||||||
|
int c = a / b;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 99 KiB |
@@ -0,0 +1,17 @@
|
|||||||
|
/* Type your code here, or load an example. */
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <assert.h>
|
||||||
|
// int main(void) {
|
||||||
|
// int a = 26;
|
||||||
|
// int b = 5;
|
||||||
|
// int c = a / b;
|
||||||
|
// return 0;
|
||||||
|
// }
|
||||||
|
unsigned short swap_bytes(unsigned short num) {
|
||||||
|
return ((num & 0x00FF) << 8) | ((num >> 8));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 98 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 120 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 74 KiB |
@@ -0,0 +1,13 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int main(void) {
|
||||||
|
const long long x = 5;
|
||||||
|
long long factorial = 1;
|
||||||
|
|
||||||
|
for (long long i = 1; i <= x; ++i) {
|
||||||
|
factorial *= i;
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("%lld! = %lld\n", x, factorial);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
## Юсуфов Алим
|
||||||
|
### Ex 1
|
||||||
|

|
||||||
|
|
||||||
|
### Ex 2
|
||||||
|

|
||||||
|
|
||||||
|
### Ex 3
|
||||||
|

|
||||||
|
|
||||||
|
### Ex 4
|
||||||
|

|
||||||
|
|
||||||
|
## Ex 5
|
||||||
|
## Описание уровней оптимизации
|
||||||
|
**-O0** — цикл остаётся циклом: генерируются инструкции сравнения, перехода и умножения в точном соответствии с исходным кодом.
|
||||||
|
- **-O1** — базовые оптимизации: структура цикла сохраняется, удаляются лишние операции.
|
||||||
|
- **-O2** — полное развёртывание цикла (loop unrolling): вместо цикла — последовательность умножений; инструкции сравнения и переходов отсутствуют.
|
||||||
|
- **-O3** — дополнительно применяется сворачивание констант (constant folding): при известных входных данных компилятор подставляет готовый результат (например, для `x = 5` — значение `120`).
|
||||||
Reference in New Issue
Block a user