We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Java Simple Code
/* Saving page no as key in hashMap, value as pages turns(steps)
pageNo steps
0 0
1 0
2 1
3 1
4 2
5 2
so on....*/
Java Simple Code
import java.util.*;
public class DrawingBookPages
{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt(); //no of pages in book
int p = sc.nextInt(); // page to turn to
Drawing Book
You are viewing a single comment's thread. Return to all comments →
Java Simple Code /* Saving page no as key in hashMap, value as pages turns(steps) pageNo steps 0 0 1 0
Java Simple Code import java.util.*;
public class DrawingBookPages { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); //no of pages in book int p = sc.nextInt(); // page to turn to
}