[问题] 征求高手协助

楼主: 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