Skip to content

Commit

Permalink
練習問題のC++の文法を修正 (#27)
Browse files Browse the repository at this point in the history
* add semicolon

* add type specifiers
  • Loading branch information
comavius authored May 9, 2024
1 parent 54bf94e commit 7509769
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions docs/text/chapter-5/practice/divide-each-difficulty.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ int fibonatti(int index) {
int main() {
int n;
cin >> n;
for (i = 0; i < n; i++) {
for (j = 0; j < n; j++) {
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
int fib_ij = fibonatti(i*j);
cout << fib_ij << " ";
}
Expand All @@ -59,7 +59,7 @@ using namespace std;
int fibonatti(int index) {
int first = 1, second = 1;
for (k = 0; k < index; k++) {
for (int k = 0; k < index; k++) {
int next = first + second;
first = second;
second = next;
Expand All @@ -70,8 +70,8 @@ int fibonatti(int index) {
int main() {
int n;
cin >> n;
for (i = 0; i < n; i++) {
for (j = 0; j < n; j++) {
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
int fib_ij = fibonatti(i*j);
cout << fib_ij << " ";
}
Expand Down
4 changes: 2 additions & 2 deletions docs/text/chapter-6/practice/order.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ using namespace std;
struct Item {
// ここを実装する
}
};
int main() {
vector<Item> items = {
Item{5000, "机", "それなり"},
...
}
};
// ここに 1番 2番を 解けるプログラムを書く
}
Expand Down

0 comments on commit 7509769

Please sign in to comment.