Given numRows and numCols, print a list of all seats in a theater. Rows are numbered, columns lettered, as in 1A or 3E. Print a space after each seat, including after the last. Use separate print statements to print the row and column. Ex: numRows = 2 and numCols = 3 prints:
1A 1B 1C 2A 2B 2C
My code's like:
public static void main(String[] args) {
int numRows = 2;
int numCols = 3;
int rows = 0;
int cols = 1;
char col;
while (rows < numRows) {
rows++;
col='A';
while (cols <= numCols) {
System.out.print("" + rows + col + " ");
col++;
cols++;
}
}
System.out.println(" ");
return;
}
}
And my output's like:
1A 1B 1C
I tried to make it like:
1A 1B 1C 2A 2B 2C
Why my loop stop at 1?
Here's what I came up with for this particular ZyBooks challenge (I used my own iterables instead of their pre-defined ones out of habit):
import java.util.Scanner;
public class NestedLoops {
public static void main (String [] args) {
Scanner scnr = new Scanner(System.in);
int numRows;
int numColumns;
int currentRow;
int currentColumn;
char currentColumnLetter;
numRows = scnr.nextInt();
numColumns = scnr.nextInt();
for (int i = 1; i <= numRows; i++) {
currentColumnLetter = 'A';
for (int x = 1; x <= numColumns; x++) {
System.out.print(i);
System.out.print(currentColumnLetter + " ");
currentColumnLetter++;
}
}
System.out.println("");
}
}
add a line cols = 1; just after rows++;
You didn't reset the value of cols in the outer loop. So the second time through the outer loop, the inner loop never gets run at all. Also consider using a for loop:
for (int rows = 0; rows < numRows; ++rows) {
// ...
for (int cols = 0; cols < numCols; ++cols) {
// ...
}
}
On the first iteration, when it goes over the inner while, you update the value of "cols".
So when this while is done, cols = 3.
Then on the second iteration, you still have cols=3 which is > numCols so it doesn't execute the while loop.
As said Parasu just add "cols = 1;" before the inner loop and it'll works.
This uses a for loop
public class NestedLoops {
public static void main (String [] args) {
int numRows = 2;
int numCols = 3;
int i = 0;
int j = 0;
char rows;
char columns;
rows = '1';
for (i = 0; i < numRows; ++i) {
columns = 'A';
for (j = 0; j < numCols; ++j) {
System.out.print("" + rows + columns + " ");
columns++;
}
rows++;
}
System.out.println("");
return;
}
}
public class NestedLoops_2 {
public static void main (String [] args) {
int numRows = 2;
int numCols = 5;
for (int i = 1; i <= numRows; i++){
char abc = 'A';
for (int j = 1; j <= numCols; ++j) {
System.out.print("" + i + abc + " ");
++abc;
}
}
System.out.println("");
return;
}
}
You have to just make a small change in your code. After the inner while loop but just inside the outer while loop write cols=1;... because the next time when the loop reaches the same inner while loop cols have to again start at 1 and not at some other value .
Just change the position of cols = 1;
public static void main(final String[] args){
int numRows = 2;
int numCols = 3;
int rows = 0;
while (rows < numRows) {
rows++;
int cols = 1;
char col = 'A';
while (cols <= numCols) {
System.out.print("" + rows + col + " ");
col++;
cols++;
}
}
System.out.println(" ");
}
I know this is late, but I am going through this same challenge in zybooks. My initial code is a little different and the answers above were a little off from what the IDE was testing for. So I decided to copy and paste my code in case anyone needs a little help with this challenge.
import java.util.Scanner;
public class NestedLoops {
public static void main (String [] args) {
Scanner scnr = new Scanner(System.in);
int numRows;
int numColumns;
int currentRow;
int currentColumn;
char currentColumnLetter;
numRows = scnr.nextInt(); // user input for how many rows
numColumns = scnr.nextInt(); // user input for many columns
/* Your solution goes here */
currentRow = 0; // Must be intialized to 0 or a "2" will print before "1"
while (currentRow < numRows) { // Intialized the loop
currentRow++; // increments the currentRow
currentColumnLetter = 'A'; // Sets the first column to char 'A'
currentColumn = 1; // Define to intialize inner loop
while (currentColumn <= numColumns) { // Will initial for any positive input 1 +
System.out.print(currentRow); // Asked specifically for 2 printouts
System.out.print(currentColumnLetter + " "); // 2nd printout with space at end.
currentColumnLetter++; // increments the Letter
currentColumn++; // increments the column
}
}
System.out.println("");
}
}
I hope this helps anyone needing a little help with this assignment.
import java.util.Scanner;
public class NestedLoops {
public static void main (String [] args) {
Scanner scnr = new Scanner(System.in);
int numRows;
int numColumns;
int currentRow;
int currentColumn;
char currentColumnLetter; //not needed
numRows = scnr.nextInt();
numColumns = scnr.nextInt();
String currentColumnL;
char[] alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".toCharArray();
for(currentRow = 1; currentRow <= numRows; currentRow = currentRow + 1) {
for(currentColumn = 1; currentColumn <= numColumns; currentColumn = currentColumn + 1) {
currentColumnL = Character.toString(alphabet[currentColumn-1]);
System.out.print("" + currentRow + currentColumnL + " ");
}
}
System.out.println("");
}
}
This is my solution to 4.7.2: Nested loops: Print seats, I did not use char currentColumnLetter
This was my solution. This one was really tough!
One thing to point out, you cannot print the string and the char within the same print statement. I'm not sure why but it will not run if you do.
import java.util.Scanner;
public class NestedLoops {
public static void main (String [] args) {
Scanner scnr = new Scanner(System.in);
int numRows;
int numColumns;
int currentRow;
int currentColumn;
char currentColumnLetter;
numRows = scnr.nextInt();
numColumns = scnr.nextInt();
for(currentRow = 1; currentRow <= numRows; currentRow++){
// Set the starting column letter
currentColumnLetter = 'A';
for(currentColumn = 0; currentColumn < numColumns; currentColumn++){
System.out.print(currentRow);
System.out.print(currentColumnLetter + " ");
currentColumnLetter++;
}
}
System.out.println("");
}
}
Related
The contents of the matrix starts from 1 to the product of rows and columns. The method "scan" should print out as per following:
If the row is entered 4 and column is entered 7, the contents of the matrix should look like the image provided here:
the correct matrix
So far I have tried absolutely noting because I just don't know how to make this possible. I can print in zigzag, spiral but I just have no idea about this one. Please have mercy on me and grant me an insight.
This code currently prints out in a spiral pattern.
How should I modify this "scan" method so it satisfies the aforementioned condition?
import java.util.Scanner;
import java.util.Random;
public class that {
public static void main(String[] args) {
int range;
range = 100;
Scanner scn = new Scanner(System.in);
while(true) {
int m, n;
System.out.println("Enter the number of row: ");
m = scn.nextInt();
System.out.println("Enter the number of column: ");
n = scn.nextInt();
if(m <= 0||n <= 0) break;
int[][] tab = new int[m][n];
generate(tab, range);
scan(tab);
}
scn.close();
}
static int len(int x) { return (""+x).length(); }
static void generate(int[][] tab, int range) {
// Random generation
Random rg = new Random();
for(int i=0; i<tab.length; ++i)
for(int j=0; j<tab[0].length; ++j)
tab[i][j] = rg.nextInt(2*range) - range;
}
static void scan(int[][] tab) {
int m = tab.length;
int n = tab[0].length;
int totalWidth = 0;
int num = 1;
int rowStart = m - 1, rowEnd = 0, colStart = 0, colEnd = n - 1;
// Compute column widths
int[] colw = new int[n];
for(int j=0; j<n; ++j) { // For every column look down
colw[j] = len(j); // (""+j).length();
for(int i=0; i<m; ++i) {
int w = len(tab[i][j]); //("" + tab[i][j]).length();
if(w > colw[j]) colw[j] = w;
}
totalWidth += colw[j];
}
// Printing
int ris = len(m-1); // row index size
System.out.printf("%"+ris+"s ", " ");
for(int j=0; j<n; ++j)
System.out.printf("%" + colw[j] +"d ", j);
System.out.println();
System.out.printf("%"+ris+"s+"," ");
for(int j=0; j<totalWidth+n-1; ++j)
System.out.printf("-");
System.out.println();
while (rowStart >= rowEnd && colStart <= colEnd) {
// Print leftmost column from bottom to top
if (colStart <= colEnd) {
for (int i = rowStart; i >= rowEnd; i--) {
tab[i][colStart] = num++;
}
colStart++;
}
// Print top row from right to left
if (rowStart >= rowEnd) {
for (int i = colStart; i <= colEnd; i++) {
tab[rowEnd][i] = num++;
}
rowEnd++;
}
// Print rightmost column from top to bottom
if (colStart <= colEnd) {
for (int i = rowEnd; i <= rowStart; i++) {
tab[i][colEnd] = num++;
}
colEnd--;
}
// Print bottom row from left to right
if (rowStart >= rowEnd) {
for (int i = colEnd; i >= colStart; i--) {
tab[rowStart][i] = num++;
}
rowStart--;
}
}
// Prints the matrix
for(int i=0; i<m; ++i) {
System.out.printf("%"+ris+"d|", i);
for(int j=0; j<n; ++j)
System.out.printf("%" + colw[j] +"d ", tab[i][j]);
System.out.println();
}
System.out.println();
}
}
I'm supposed to do this.
Multi-dimensional array Cinema
The cinema has n rows, each row consists of m seats (n and m do not
exceed 20). The two-dimensional matrix stores the information on the
sold tickets, number 1 means that the ticket for this place is already
sold, the number 0 means that the place is available. You want to buy
k tickets to the neighboring seats in the same row. Find whether it
can be done.
Input data format
On the input, the program gets the number of n rows and m seats. Then,
there are n lines, each containing m numbers (0 or 1) separated by
spaces. The last line contains a number k.
Output data format
The program should output the number of the row with k consecutive
available seats. If there are several rows with k available seats,
output the first row with these seats. If there is no such a row,
output the number 0.
But I'm stuck at finding a proper if statement to find the same adjacent coordinates k number of times
import java.util.Scanner;
import java.util.*;
class Main {
public static void main(String[] args) {
// put your code here
Scanner scanner= new Scanner(System.in);
int dim1=scanner.nextInt();
int dim2=scanner.nextInt();
int[][] twoDimArray=new int[dim1][dim2];
// for (int i = 0; i < twoDimArray.length; i++) {
// twoDimArray[i][i]=scanner.nextInt();
//System.out.println(Arrays.toString(twoDimArray[i]));
// }
for (int i=0;i<dim1;i++){
for (int j=0;j<dim2;j++){
int current=scanner.nextInt();
twoDimArray[i][j]=current;
}
}
/* for (int k = 0; k< dim1; k++)
{
for (int l= 0; l< dim2;l++)
{
System.out.print(twoDimArray[k][l] + " ");
}
System.out.println("");
}
*/
int seatsToBuy=scanner.nextInt();
for (int k = 0; k< dim1; k++)
{
for (int l= 0; l< dim2;l++)
{
if ((twoDimArray[k][l]==twoDimArray[k][l+1])&&l<dim2){
System.out.println(twoDimArray[k]);
break;
}
}
System.out.println("");
}
I modified your code a bit. Can you try the below modified code?
import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int dim1 = scanner.nextInt();
int dim2 = scanner.nextInt();
int[][] twoDimArray = new int[dim1][dim2];
for (int i = 0; i < dim1; i++) {
for (int j = 0; j < dim2; j++) {
int current = scanner.nextInt();
twoDimArray[i][j] = current;
}
}
for (int i = 0; i < dim1; i++) {
for (int j = 0; j < dim2; j++) {
System.out.print(twoDimArray[i][j] + " ");
}
System.out.println();
}
int seatsToBuy=scanner.nextInt();
int minConsSeats = seatsToBuy - 1;
int rowNum = 0;
for (int k = 0; k< dim1; k++)
{
int count = 0;
for (int l= 0; l< dim2;l++) {
if (twoDimArray[k][l] == 0 && count == minConsSeats) {
count ++;
} else if (l+1 < dim2 && twoDimArray[k][l] == 0 && twoDimArray[k][l+1] == 0) {
count++;
}
}
if (count >= seatsToBuy) {
rowNum = k + 1;
break;
}
}
System.out.println("Available row number: " + rowNum);
}
}
First I'd name variables with expressive names, not i, j, k, etc ..
So first gather inputs, I think you did that fine, I just renamed variables:
Scanner scanner = new Scanner(System.in);
System.out.print("Number of Rows: ");
int nbRows = scanner.nextInt();
System.out.print("Number of Cols: ");
int nbCols = scanner.nextInt();
int[][] seats = new int[nbRows][nbCols];
for (int row = 0; row < nbRows; row++) {
System.out.println("Row " + row);
for (int col = 0; col < nbCols; col++) {
System.out.print("Col " + col +": ");
int availability = scanner.nextInt();
seats[row][col] = availability;
}
}
System.out.print("Number of Seats to buy: ");
int seatsToBuy = scanner.nextInt();
Then it is always useful to have a little sanity check on what was input, so here is a little snippet to print out the seats for debugging
for (int row = 0; row < nbRows; row++) {
for (int col = 0; col < nbCols; col++) {
System.out.print(seats[row][col] + " ");
}
System.out.println();
}
Then I would use the following algorithm:
starts a counter at the beginning of the row to keep track of the maximum number of adjacent seats (maxAdjacentSeatsInRow). Then go seat by seat, if it is available, then increment the counter. If it is not, reset the counter to zero.
If at any point the counter equals the required number of seats, then that row is the one you want to return:
int availableRow = -1;
for (int row = 0; row < nbRows; row++) {
int maxAdjacentSeatsInRow = 0;
for (int col = 0; col < nbCols; col++) {
if(seats[row][col] == 0)
maxAdjacentSeatsInRow++;
else
maxAdjacentSeatsInRow = 0;
if (maxAdjacentSeatsInRow == seatsToBuy) {
availableRow = row;
break; // break out of the col loop
}
}
if(availableRow >= 0) {
break; // break out of the row loop if we found a row
}
}
// print out result
if(availableRow == -1) {
System.out.println("No seats available");
} else {
System.out.println("Seats available at row: " + availableRow);
}
Sample output:
Number of Rows: 3
Number of Cols: 4
Row 0
Col 0: 1
Col 1: 1
Col 2: 1
Col 3: 1
Row 1
Col 0: 1
Col 1: 0
Col 2: 0
Col 3: 1
Row 2
Col 0: 1
Col 1: 1
Col 2: 0
Col 3: 0
Number of Seats to buy: 2
1 1 1 1
1 0 0 1
1 1 0 0
Seats available at row: 1
The row index in the answer is zero based.
Also don't hesitate to make methods it makes things easier to read. Here is a version of the same thing but with methods:
private static final Scanner scanner = new Scanner(System.in);
public static void main(String[] args) {
System.out.print("Number of Rows: ");
int nbRows = scanner.nextInt();
System.out.print("Number of Cols: ");
int nbCols = scanner.nextInt();
int[][] seats = gatherSeatsInputs(nbRows, nbCols);
System.out.print("Number of Seats to buy: ");
int seatsToBuy = scanner.nextInt();
printSeats(seats);
int availableRow = findAvailableRow(seats, seatsToBuy);
if(availableRow == -1) {
System.out.println("No seats available");
} else {
System.out.println("Seats available at row: " + availableRow);
}
}
private static int[][] gatherSeatsInputs(int nbRows, int nbCols) {
int[][] seats = new int[nbRows][nbCols];
for (int row = 0; row < nbRows; row++) {
System.out.println("Row " + row);
for (int col = 0; col < nbCols; col++) {
System.out.print("Col " + col +": ");
int current = scanner.nextInt();
seats[row][col] = current;
}
}
return seats;
}
private static int findAvailableRow(int[][] seats, int seatsToBuy) {
for (int rowIndex = 0; rowIndex < seats.length; rowIndex++) {
if(rowHasEnoughSeats(seats[rowIndex], seatsToBuy)) {
return rowIndex;
}
}
return -1;
}
private static boolean rowHasEnoughSeats(int[] row, int seatsToBuy) {
int maxAdjacentSeatsInRow = 0;
for (int seatAvailability : row) {
if (seatAvailability == 0) {
maxAdjacentSeatsInRow++;
if (maxAdjacentSeatsInRow == seatsToBuy) {
return true;
}
} else {
maxAdjacentSeatsInRow = 0;
}
}
return false;
}
private static void printSeats(int[][] seats) {
for (int[] row : seats) {
for (int seat : row) {
System.out.print(seat + " ");
}
System.out.println();
}
}
i am having trouble with reversing this code. what i am trying to have as
this is what i have so far but i can't seem to wrap my head around how the third for loop is supposed to be
public static void main(String[] args) {
Scanner input = new Scanner(System.in); //gets the users input
int rows;
int number = 0;
int i = 0;
rows = input.nextInt(); //takes the users input from console
while (rows <= 0) {
System.out.println("INVALID");
rows = input.nextInt();
}
for (int c = 1; c <= rows; c++) {
for (i = 0; i < c; i++) {
System.out.print(++number + " ");
}
for (int j = c; j < rows; j++) {
System.out.print("* * ");
}
for(i = 0; i < c; i++) {
System.out.print(number + " ");
//number--;
}
System.out.println();
}
Before running your last loop you should store number in some temp variable:
int temp = number;
for(i = 0; i < c; i++) {
System.out.print(temp-- + " ");
}
As I said in the comment, you need to decrement the number but at the same time need to keep track of the highest values in a line to use it as a starting value in the next iteration. Something like this should work:
public static void main(String[] args) {
int rows;
int number = 0;
int highestValue = 0;
int i = 0;
rows = 5;
for (int c = 1; c <= rows; c++) {
number = highestValue; // reset number to the highest value from previous line
for (i = 0; i < c; i++) {
System.out.print(++number + " ");
}
highestValue = number; // setting the highest value in line
for (int j = c; j < rows; j++) {
System.out.print("* * ");
}
for(i = 0; i < c; i++) {
System.out.print(number-- + " "); // decrementing
}
System.out.println();
}
Do you have to implement this yourself, because otherwise there are tons of libraries handling arrays.
The steps you have to take are:
Find a way to read the input (integers) in a single line and store them in some kind of container (either an array, or a list).
You may have to isolate what a single integer is (e.g. "1 2 3" is 3 integers, which you want to reverse, while "12 3" is just 2, and you only want to reverse 2).
You need to ensure that your input is valid (e.g. a user may enter "1 a b c")
You need to flip the integers within the container or better copy the original container in reverse order. For this, you only need to iterate over the container's elements and add them to the target container in reverse order
for (Integer in : inputList) {
outputList.addFirst(in);
}
If you only want to print the integers, you don't have to store them in a list, you could just iterate over the container in reverse order.
It seems to bit a pattern program, you can add the number-- in you sysout
public static void main( String[] args )
{
Scanner input = new Scanner(System.in); //gets the users input
int rows;
int number = 0;
int i = 0;
rows = input.nextInt(); //takes the users input from console
while (rows <= 0) {
System.out.println("INVALID");
rows = input.nextInt();
}
for (int c = 1; c <= rows; c++) {
for (i = 0; i < c; i++) {
System.out.print(++number + " ");
}
for (int j = c; j < rows; j++) {
System.out.print("* * ");
}
for(i = 0; i < c; i++) {
System.out.print(number-- + " ");
//number--;
}
System.out.println();
}
}
Such type of pattern you can create through collections
I am creating a pattern that, when user enters the number of rows, prints a triangle with a specific number pattern. I am having a hard time coming up with a mathematical equation that will output this pattern:
I have already written a code that works but not with the pattern that I am wanting to create. Can someone help me?
Here's my code so far:
import java.util.Scanner;
public class trianglePattern {
public static void main(String[] args) {
Scanner input = new Scanner (System.in);
System.out.println("How many rows?: ");
int rows = input.nextInt();
for(int i =0;i<rows;i++) {
System.out.format("%"+4*(rows-i+1)+"s","");
for(int j=i+1; j>1; j--)
System.out.format("%4d", j);
for(int j=1; j<=i+1; j++)
System.out.format("%4d", j);
System.out.println();
}
}
}
Switched the loops, added a power function and fiddled a little with the loop indexes:
import java.util.Scanner;
public class trianglePattern {
public static void main(String[] args) {
Scanner input = new Scanner (System.in);
System.out.println("How many rows?: ");
int rows = input.nextInt();
for(int i = 0; i < rows; i++) {
System.out.format("%"+4*(rows-i+1)+"s","");
for(int j = 0; j <= i; j++)
System.out.format("%4d", (int) Math.pow(2,j));
for(int j = i - 1; j >= 0; j--)
System.out.format("%4d", (int) Math.pow(2,j));
System.out.println();
}
}
}
Nice problem...
Scanner input = new Scanner(System.in);
System.out.println("How many rows?: ");
int rows = input.nextInt();
ArrayList<Integer> list = new ArrayList<>();
for(int i=0; i<rows; i++) {
list.add(i);
}
for(int i=rows-2; i>-1; i--) {
list.add(i);
}
// I print this here just for your help(delete it afterwards)
for (Integer integer : list) {
System.out.print(((int) Math.pow(2, integer)) + " ");
}
System.out.println("\n");
for(int i=rows; i>=1; i--) {
for (Integer integer : list) {
int number = ((int) Math.pow(2, integer-i+1));
if(number>=1) {
System.out.format("%d\t", ((int) Math.pow(2, integer-i+1)));
} else {
System.out.print(" ");
}
}
System.out.println("\n");
}
(Tip): in the Arraylist list i save all the exponents i need to calculate the last row of the problem.
Try this. The spacing is based on several factors.
The sum of the field widths. Each field width is kept is a list. It is used to reduce the leading space based on the row being printed.
That each column field width is sized for the maximum value in that column. The width for a given column is also maintained in a list. Since the widths are symmetric about the central column, left side formats are also used to print right side values.
Scanner input = new Scanner(System.in);
System.out.println("How many rows?: ");
int rows = input.nextInt();
List<Integer> fws = new ArrayList<>();
List<String> fmts = new ArrayList<>();
Function<Integer, Integer> fw = r -> (int) (Math
.log10(1 << r)) + 2;
int sumWidths = 0;
for (int r = 0; r < rows; r++ ) {
int f = fw.apply(r);
fws.add(f);
sumWidths += f;
fmts.add("%" + f + "d");
}
rows--;
String pad = " ".repeat(sumWidths);
for (int r = rows; r >= 0; r--) {
System.out.print(pad);
int v = 1;
for (int c = r; c < rows; c++) {
System.out.printf(fmts.get(c), v);
v <<= 1;
}
System.out.printf(fmts.get(rows), v);
for (int c = rows-1; c >= r; c--) {
v >>= 1;
System.out.printf(fmts.get(c), v);
}
System.out.println();
pad = pad.substring(r > 0 ? fws.get(r-1) : pad.length());
}
}
i am trying to print all numbers greater than 75 but it seems that the only last line of numbers which is greater than 75 will be printed. Any help will be appreciated tnx.
public static void main(String[] args) {
int[] numList = new int[100];
int column;
int count = 0;
for(int row=0;row<10;row++){
for(column=0;column<10;column++)
{
numList[column] = (int)(Math.random()*100);
System.out.print(numList[column]+" ");
}
System.out.println(" ");
}
System.out.println("Greater than 75:");
for(int row=0;row<1;row++){
count++;
for(column=0;column<10;column++)
{
numList[row] = numList[column];
if(numList[column] >75)
System.out.print(numList[column]+ ",");
}
}
}
}
You are creating 1D array and overriding the first 10 values always in your loop numList[column] = (int)(Math.random()*100); , i think 2D array is what you are looking for
int[][] numList = new int[10][10];
int column;
for (int row = 0; row < 10; row++) {
for (column = 0; column < 10; column++) {
numList[row][column] = (int) (Math.random() * 100);
System.out.print(numList[row][column] + " ");
}
System.out.println(" ");
}
System.out.println("Greater than 75:");
for (int row = 0; row < 10; row++) {
for (column = 0; column < 10; column++) {
if (numList[row][column] > 75) {
System.out.print(numList[row][column] + ",");
}
}
}
You never declare a matrix. You just have a 1-D array which you keep overwriting. For a matrix you need a 2-D array :
int[][] numList = new int[10][10];
int column;
int count = 0;
for(int row=0;row<numList.length;row++){
for(column=0;column<numList[row].length;column++) {
numList[row][column] = (int)(Math.random()*100);
System.out.print(numList[row][column]+" ");
}
System.out.println(" ");
}
System.out.println("Greater than 75:");
for(int row=0;row<numList.length;row++) {
for(column=0;column<numList[row].length;column++) {
if(numList[row][column] >75)
System.out.print(numList[row][column]+ ",");
}
}