vfp编写程序实现矩阵的转置
1个回答
展开全部
DIMENSION a(3,4),c(3)
? "转置前的矩阵:"
?
For i = 1 To 3
hz = 0
For j = 1 To 4
d = RAND() * 90 + 10
a(i, j) = d
hz = d + hz
?? d
endfor
c(i) = hz
?
ENDFOR
? "转置后的矩阵:"
?
For i = 1 To 4
For j = 1 To 3
?? a(j, i)
Next
?
Next
For i = 1 To 3
? "第" + STR(i,1)+ "行元素之和为:" +STR( c(i),3)
Next
? "转置前的矩阵:"
?
For i = 1 To 3
hz = 0
For j = 1 To 4
d = RAND() * 90 + 10
a(i, j) = d
hz = d + hz
?? d
endfor
c(i) = hz
?
ENDFOR
? "转置后的矩阵:"
?
For i = 1 To 4
For j = 1 To 3
?? a(j, i)
Next
?
Next
For i = 1 To 3
? "第" + STR(i,1)+ "行元素之和为:" +STR( c(i),3)
Next
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询