Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
14
Task/Identity-matrix/Elena/identity-matrix.elena
Normal file
14
Task/Identity-matrix/Elena/identity-matrix.elena
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import extensions;
|
||||
import system'routines;
|
||||
import system'collections;
|
||||
|
||||
public program()
|
||||
{
|
||||
var n := console.write:"Enter the matrix size:".readLine().toInt();
|
||||
|
||||
var identity := new Range(0, n).selectBy:(i => new Range(0,n).selectBy:(j => (i == j).iif(1,0) ).summarize(new ArrayList()))
|
||||
.summarize(new ArrayList());
|
||||
|
||||
identity.forEach:
|
||||
(row) { console.printLine(row.asEnumerable()) }
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue