---
title: Test Blog 测试内容
date: '2026-01-15'
tags: ['markdown', 'code', 'features']
draft: false
summary: Test blog contents 测试内容
---

## Code Blocks

Begins With C

```c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void merge(int* arr, int l, int r){
  int mid = (l + r) / 2;
  int tmp[114514];
  int p = 0;
  int i = l, j = mid + 1;
  while( i <= mid && j <= r){
    if(arr[i] <= arr[j]) tmp[p++] = arr[i++];
    else tmp[p++] = arr[j++];
  }
  while(i <= mid) tmp[p++] = arr[i++];
  while(j <= r) tmp[p++] = arr[j++];

  for(size_t x = l; x <= r; x++){
    arr[x] = tmp[x - l];
  }
}
void mergesort(int* arr, int l, int r){
  if(l >= r) return;
  int mid = (l + r) / 2;
  mergesort(arr, l, mid);
  mergesort(arr, mid + 1, r);
  merge(arr, l, r);
}

int main(){
  int n;
  scanf("%d", &n);
  int* arr = (int*)malloc(n * sizeof(int));
  for(int i = 0; i < n; ++i){
    scanf("%d", &arr[i]);
  }
  mergesort(arr, 0, n - 1);
  for(int i = 0; i < n; ++i){
    printf("%d ", arr[i]);
  }
  printf("\n");
  return 0;
}
```

Some C++ Codes

```cpp
#include <iostream>
#include <thread>
#include <vector>
using namespace std;

int times(int x){
    int r = 1;
    for(int i = 2; i <= x; i++) r *= i;
    return r;
}

void sum_to_n(int n, int& result){
    int tmp = 0;
    for(int i = 1; i <= n; i++) tmp += i;
    result = tmp;
}

void fact_table(int n, vector<int>& out){
    out.resize(n);
    for(int i = 1; i <= n; i++){
        out[i-1] = times(i);
    }
}

int main(){
    int n;
    cin >> n;

    int sum;
    vector<int> facts;
    int fn;
    
    thread t1(sum_to_n, n, ref(sum));
    thread t2(fact_table, n, ref(facts));
    thread t3([&](){ fn = times(n); });

    t1.join();
    t2.join();
    t3.join();

    cout << sum << endl;
}
```

Some Java Codes
```Java
import java.util.*;

public class Matrix{
    public int[] arr;
    public int n;
    public int m;

    public Matrix(int[] a, int n, int m){
        this.arr = a;
        this.n = n;
        this.m = m;
    }
    public Matrix add(Matrix m){
        if(m.arr.length != this.arr.length){
            System.out.println("Invalid Add");
            return null;
        }
        int[] narr = new int[arr.length];
        for(int i = 0; i < arr.length; i++){
            narr[i] = arr[i] + m.arr[i];
        }
        Matrix tmp = new Matrix(narr, this.n, this.m);
        return tmp;
    }
    public void print(){
        for(int i = 0; i < n; i++){
            for(int j = 0; j < m; j++){
                System.out.print(arr[i * m + j]);
                System.out.print(" ");
            }
            System.out.println();
        }
    }
}

```
