Created
July 13, 2021 07:02
-
-
Save moosongsong/5bacd1dba3457363ecf36e040173cc4a to your computer and use it in GitHub Desktop.
백준 2292
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class Main { | |
public static void main(String[] args) { | |
Scanner scanner = new Scanner(System.in); | |
int n = scanner.nextInt(); | |
int start = 0; | |
int count = 1; | |
if (n != 1) | |
while (start + 1 < n) { | |
start += 6 * count; | |
count++; | |
} | |
System.out.println(count); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment