posted 9 years ago

hye, i'm not quite able to figure this out, if someone can help by showing some example code :

i wanna enter integers into the variables from console after running program,am unable to do it with readInt(), also the input speciication is a space between integers. which are then taken as row and column of an int array.

p.s :pl reply ASAP, have been sitting on this too long.

i wanna enter integers into the variables from console after running program,am unable to do it with readInt(), also the input speciication is a space between integers. which are then taken as row and column of an int array.

p.s :pl reply ASAP, have been sitting on this too long.

chintan chainani

Greenhorn

Posts: 7

posted 9 years ago

thanks jitesh that worked fine on the command line, but what i was looking for is the how does the program with main() , prompt user to enter the numbers, after program is run.

let me just print the whole problem : (maybe this will belong to java beginner,but since you replied I will just type it here..thanks)

REMOVAL OF 'ZERO ROWS AND COLUMNS IN A MATRIX.

given an integer matrix of size, say, M x N, to write a program to remove all the rows and columns consisting of all zeroes.

INPUT SPECIFICATION:

the first line of input will have 2 integers , say M and N, separated by a space, specifying number of row and column in matrix.

This will be followed by M LINES, EACH consisting of N integers.

assuming M and N can be between 1 and 10 only.

/*now i have got the logic for the program but am a little (or majorly)confused with input classes . So if you or someone could please help me with this ....

let me just print the whole problem : (maybe this will belong to java beginner,but since you replied I will just type it here..thanks)

REMOVAL OF 'ZERO ROWS AND COLUMNS IN A MATRIX.

given an integer matrix of size, say, M x N, to write a program to remove all the rows and columns consisting of all zeroes.

INPUT SPECIFICATION:

the first line of input will have 2 integers , say M and N, separated by a space, specifying number of row and column in matrix.

This will be followed by M LINES, EACH consisting of N integers.

assuming M and N can be between 1 and 10 only.

/*now i have got the logic for the program but am a little (or majorly)confused with input classes . So if you or someone could please help me with this ....

Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |