1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
real [int,int] a(10,10);
real [int] b(10);
for [i,bi : b] {bi=i+1; cout << i << " " << bi << endl;}
cout << " b="<< b<< endl;
for [i,j,aij : a]
{
aij= 1./(2+i+j);
if(abs(aij)<0.2) aij=0;
}
cout << " a= "<< a << endl;
matrix A=a;
string[string] ss;
ss["1"]= 1;
ss["2"]= 2;
ss["3"]= 5;
for [i,bi : ss]
bi=i+6+"-dddd";
cout <<" ss = "<< ss << endl;
int[string] si;
si[1]=2;
si[50]=1;
for [i,vi : si]
{
cout << " i " << setw(3) << i << " " << setw(10) <<vi << endl;
vi= atoi(i)*2;
}
cout <<" si = "<< si << endl;
for [i,j,aij : A]
{
cout << i<< " " << j <<" " << aij << endl;
aij= -aij;
}
cout << A << endl;
real[string] sd;
sd["1"]= 1;
sd["2"]= 2;
sd["3"]= 5;
for [i,bi : sd]
bi=bi*bi;
cout << "sd=\n"<< sd <<endl ;
|