<script>
window.onload = function () {//onload begin
var x = 2;
var y = 2;
var mas = [];
for (var i = 0; i < x; i++) {
mas[i] = [];
for (var j = 0; j < y; j++) {
mas[i][j] = parseInt(prompt('Введите элемент [' + i + ',' + j + ']'));
document.write('[' + i + ',' + j + '] = ' + mas[i][j] + '; ');
}
document.write('<br>')
}
var max = mas[0][0];
for (var i = 0; i < x; i++) {
for (var j = 0; j < y; j++) {
if (mas[i][j] > max) {
max = mas[i][j];
}
}
}
document.write('<br><br>max = ' + max)
}//onload end
</script>
|