Skip to content

Commit d4c05bb

Browse files
[ci] generate question examples
1 parent d4d966f commit d4c05bb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+207
-5
lines changed

public/docs/cpp/1-types-control/1-0-basic-types.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
id: cpp-types-basic
33
title: 基本的なデータ型
44
level: 2
5+
question:
6+
- '`int`が「通常4バイト」というのは、常にそうではないということですか?'
7+
- '`long long`はどれくらいの範囲の整数を扱えますか?'
8+
- '`char`と`std::string`はどちらも文字を扱うのに、どのように使い分けますか?'
9+
- '`std::string`はなぜ「厳密には基本型ではありません」と書かれているのですか?'
510
---
611

712
## 基本的なデータ型

public/docs/cpp/1-types-control/2-0-uniform-init.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
---
22
id: cpp-types-uniform-init
3-
title: '変数の初期化:ユニフォーム初期化 {}'
3+
title: 変数の初期化:ユニフォーム初期化 {}
44
level: 2
5+
question:
6+
- 縮小変換(Narrowing Conversion)とは具体的にどのような状況で起こるのですか?
7+
- '`int age = 25;` と `int age{25};` は、なぜ `{}` の方がより安全なのですか?'
8+
- '`{}`による初期化は、どんな型の変数でも使えるのですか?'
9+
- 縮小変換を防ぐ以外に、ユニフォーム初期化を使うメリットはありますか?
510
---
611

712
## 変数の初期化:ユニフォーム初期化 `{}`

public/docs/cpp/1-types-control/3-0-modifier.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
id: cpp-types-modifier
33
title: 型を厳密に扱う
44
level: 2
5+
question:
6+
- 「型を厳密に扱う」ことがなぜC++では重要なのでしょうか?
7+
- このセクションのタイトルにある「仕組み」とは、`const`や`auto`以外にどんなものがありますか?
58
---
69

710
## 型を厳密に扱う

public/docs/cpp/1-types-control/3-1-const.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
id: cpp-types-const
33
title: constによる不変性の保証
44
level: 3
5+
question:
6+
- '`const`は、一度宣言したら本当に全く変更できないのですか?'
7+
- '`const`を使うことで、プログラムの実行速度が速くなるなどのメリットはありますか?'
8+
- '`const`をどこにでも付けるべきでしょうか、それとも特定の場面で使うべきですか?'
59
---
610

711
### `const`による不変性の保証

public/docs/cpp/1-types-control/3-2-auto.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
id: cpp-types-auto
33
title: autoによる型推論
44
level: 3
5+
question:
6+
- '`auto`を使うと型が分からなくなるデメリットはないのですか?'
7+
- '`auto z = "hello";` が `const char*` になるのはなぜですか? `std::string`にはならないのですか?'
8+
- '`auto`はどの場面で使うのが一番効果的ですか?'
59
---
610

711
### `auto`による型推論

public/docs/cpp/1-types-control/4-0-console.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
---
22
id: cpp-types-console
3-
title: 'コンソール入出力 (std::cin, std::cout)'
3+
title: コンソール入出力 (std::cin, std::cout)
44
level: 2
5+
question:
6+
- '`std::endl`と`\n`の違いは何ですか?どちらを使うべきですか?'
7+
- '`std::cin`でスペースを含む文字列(例えば "John Doe")を入力するにはどうすればいいですか?'
8+
- C言語の`printf`/`scanf`はC++では使ってはいけないのですか?
59
---
610

711
## コンソール入出力 (`std::cin`, `std::cout`)

public/docs/cpp/1-types-control/5-0-control.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
id: cpp-control
33
title: 制御構文:if, switch, while, for
44
level: 2
5+
question:
6+
- C++の制御構文が「他のC系言語とほぼ同じ」とのことですが、具体的に違う点はどんなところですか?
7+
- このセクションで触れていない、他に重要な制御構文はありますか?
58
---
69

710
## 制御構文:if, switch, while, for

public/docs/cpp/1-types-control/5-1-if.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
id: cpp-control-if
33
title: if文
44
level: 3
5+
question:
6+
- '`if`文の条件式で`bool`型ではない値(例: `int`型)を使った場合、どのように`true`/`false`が判断されるのですか?'
7+
- '`if-else if`と`switch`文は、どのように使い分けるのが良いですか?'
58
---
69

710
### `if`

public/docs/cpp/1-types-control/5-2-switch.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
id: cpp-control-switch
33
title: switch文とフォールスルー
44
level: 3
5+
question:
6+
- '`switch`文で文字列を比較することはできますか?'
7+
- フォールスルーはどんな場面で便利に使えるのですか?
8+
- '`default`ケースは必ず書くべきですか?書かなかった場合どうなりますか?'
59
---
610

711
### `switch`文とフォールスルー

public/docs/cpp/1-types-control/5-3-loop.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
id: cpp-control-loop
33
title: ループ構文
44
level: 3
5+
question:
6+
- '`while`ループと`for`ループは、どちらをどんな時に使うのが適切ですか?'
7+
- '`for`ループのカウンタを`--i`にするのと`i--`にするのでは何か違いがありますか?'
8+
- '`for`ループの初期化式、条件式、更新式はすべて記述しないといけませんか?'
59
---
610

711
### ループ構文

0 commit comments

Comments
 (0)