From 1ccc2929b73ecaf38164a43ad8de9d9d2fac3b58 Mon Sep 17 00:00:00 2001 From: Henry Mai Date: Fri, 26 May 2023 15:37:59 +0930 Subject: [PATCH] docs: fix ordinal numbers '1th' and '2th' --- source/_posts/awk.md | 4 ++-- source/_posts/cpp.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/_posts/awk.md b/source/_posts/awk.md index 2c4f6d1..f2d837b 100644 --- a/source/_posts/awk.md +++ b/source/_posts/awk.md @@ -171,14 +171,14 @@ Awk Variables |---------------------|------------------------------------| | `$1 == "root"` | First field equals root | | `{print $(NF-1)}` | Second last field | -| `NR!=1{print $0}` | From 2th record | +| `NR!=1{print $0}` | From 2nd record | | `NR > 3` | From 4th record | | `NR == 1` | First record | | `END{print NR}` | Total records | | `BEGIN{print OFMT}` | Output format | | `{print NR, $0}` | Line number | | `{print NR " " $0}` | Line number (tab) | -| `{$1 = NR; print}` | Replace 1th field with line number | +| `{$1 = NR; print}` | Replace 1st field with line number | | `$NF > 4` | Last field > 4 | | `NR % 2 == 0` | Even records | | `NR==10, NR==20` | Records 10 to 20 | diff --git a/source/_posts/cpp.md b/source/_posts/cpp.md index 0e8132a..bd8a00a 100644 --- a/source/_posts/cpp.md +++ b/source/_posts/cpp.md @@ -213,7 +213,7 @@ std::array marks = {92, 97, 98, 99, 98, 94}; // Print first element std::cout << marks[0]; -// Change 2th element to 99 +// Change 2nd element to 99 marks[1] = 99; // Take input from the user