#include <iostream>
using namespace std;
int main()
{
double array[20][20];
srand(time(0));
for (int i=0;i<20;i++)
{
for (int j=0;j<20;j++)
{
array[i][j]=(rand()%100);
}
cout<<endl;
}
double diagonal[20];
for (int i=0;i<20;i++)
{
diagonal [i]=array [i][i];
cout<<diagonal[i]<<" ";
}
cout<<endl;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKQp7Cglkb3VibGUgYXJyYXlbMjBdWzIwXTsKCXNyYW5kKHRpbWUoMCkpOwoJZm9yIChpbnQgaT0wO2k8MjA7aSsrKQoJewoJCWZvciAoaW50IGo9MDtqPDIwO2orKykKCQl7CgkJCWFycmF5W2ldW2pdPShyYW5kKCklMTAwKTsKCQl9CgkJY291dDw8ZW5kbDsKCX0gCglkb3VibGUgZGlhZ29uYWxbMjBdOwoJZm9yIChpbnQgaT0wO2k8MjA7aSsrKQoJewoJCWRpYWdvbmFsIFtpXT1hcnJheSBbaV1baV07CgkJY291dDw8ZGlhZ29uYWxbaV08PCIgIjsKCX0KCWNvdXQ8PGVuZGw7Cn0K