Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

第4章の練習問題「Fibonatti Number」を修正 #29

Merged
merged 6 commits into from
May 30, 2024

Conversation

YuHima03
Copy link
Contributor

何をしたか

  • fibonatti.mdを修正
    • 表記を修正
      • 整数N正の整数N
    • フィボナッチ数列の初項を1とする旨を明記
    • 解答のコードを修正

@YuHima03 YuHima03 requested a review from Takeno-hito as a code owner May 16, 2024 10:35
Copy link
Member

@Takeno-hito Takeno-hito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ちょっと確認お願いします!

@@ -24,7 +26,7 @@ int main() {
int n;
cin >> n;
int second_latest = 0, latest = 1;
for (int i = 2; i < n; i++) {
for (int i = 1; i < n; i++) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

回数のためにしか使ってないなら

Suggested change
for (int i = 1; i < n; i++) {
for (int i = 0; i < n-1; i++) {

$i$ 番目を計算するという目的にしたいなら

Suggested change
for (int i = 1; i < n; i++) {
for (int i = 2; i <= n; i++) {

としたいです

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

返信遅くなりすみません.

i番目を計算するほうが分かりやすいと思うので, その旨のコメントを追加して以下でどうでしょうか.

Suggested change
for (int i = 1; i < n; i++) {
for (int i = 2; i <= n; i++) {
// i番目を計算

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

良さげ!コミットしちゃってください

@@ -44,11 +46,11 @@ int main() {
int n;
cin >> n;
vector<int> fibonatti_sequence = {0, 1};
for (int i = 2; i < n; i++) {
for (int i = 1; i < n; i++) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同様

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

上と同様です.

Suggested change
for (int i = 1; i < n; i++) {
for (int i = 2; i <= n; i++) {
// i番目を計算

フィボナッチ数列のi番目を計算していることが分かりやすいようにした.
@YuHima03 YuHima03 requested a review from Takeno-hito May 23, 2024 09:04
Copy link
Member

@Takeno-hito Takeno-hito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM です ありがとう

@Takeno-hito Takeno-hito merged commit b820641 into traP-jp:main May 30, 2024
1 check passed
@YuHima03 YuHima03 deleted the chapter-4_fibonatti branch June 12, 2024 05:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants