[問題] 徵求高手協助

作者: hsuyuchen8 (hsuyuchen8)   2016-02-10 07:20:53
本身是化工系,毫無程式底子,這學期修了fortran的課想說增加相關經驗,結果第一次
作業就崩潰了!只好來這邊跪求高手協助。
1. Write a Fortran program to carry out random matrix multiplication by
command-line arguments to the program executable. Specifically
˙the program should be executed from the command line as
program r1 c1 m1 ... [rN cN mN]
and work correctly for an arbitrary number of r-c-m triplets.
˙for each set of command line specifications rn and cn, the program
should select random integer numbers r-[1,rn] and c-[1,cn]
˙for each set (r,c), generate a matrix pair (A,B) with dim(A)=rxc and
dim(B)=cxr and random elements in the range [0,mn] with three decimal
places.
˙multiply the matrix A and B and write the result to the screen.
˙make sure that your program compile without warnings using
gfortran -Wall -03 -o program program.f
˙make sure that your output contains one row in a line, with corresponding
row elements seperated by a space. for example,
program 2 2 4
should yeild an output as:
3.2345 4.345
2.3546 1.2345
˙in the case of multiple r-c-m triplets, the program should return the
corresponding matrices seperated by an empty line.
For example,
program 2 1 3 3 4 3
should yeild output as:
3.2345 4.345
2.3546 1.2345
3.21234 1.2345 1.782345
1.246657 5.4762 1.353645
1.23574 9.2345634 7.234345
Note the empty line between the two matrix outputs. Your output should
NOT contain an empty line at the end.
題目大概是這樣,跪求板上強者幫忙。
作者: egg9 ( )   2016-02-21 19:59:00
這是來問詳解?
作者: blc (Anemos)   2016-02-11 20:38:00
是沒想法還是英文不懂?
作者: hsuyuchen8 (hsuyuchen8)   2016-02-12 03:40:00
沒想法 大概懂題目要什麼 可是寫不出來 (才剛學不到一個月而已)

Links booklink

Contact Us: admin [ a t ] ucptt.com