I know how to read input from user in the following way
//using Scanner
int num = 0;
int x;
int y;
System.out.println("Number of points");
int num = scan.nextInt();
for(int i=0; i < num;i++)
{
x = scan.nextInt();
y = scan.nextInt();
Point p = new Point(x,y);
//using ArrayList<Point>
pts.add(p);
}
The problem I am having is that it gets the input like this
2 //number of points
0 // x1
0 //y1
3 //x2
5 //y2
How can I make it so that it looks like this
2
0 0
3 5
?
Thank you very much for your help