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

전해일 / 7주차 / 3문제 #15

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
새 / 브론즈 2 / 해결
  • Loading branch information
JeonHaeIl committed Jul 31, 2023
commit d9bef9d452dace2f544373908a6a9a0bcafb375f
21 changes: 21 additions & 0 deletions Haeil/1568.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#include <stdio.h>

int main() {
int bird;
int num = 1;
int answer = 0;
printf("");
scanf("%d", &bird);
while(bird > 0) {
bird -= num;
num += 1;
answer += 1;
if (num > bird) {
num = 1;
}
}
printf("%d\n", answer);
return 0;


}