Perl   发布时间:2019-10-06  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了About Matrix大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
#!/usr/bin/env perl6

use v6;

sub MAIN(Str :f($filE)) {
	my @lines 	= $file.IO.lines;
	my @subjects 	= @lines.shift.words;
	my @datas	= [,] @lines.map: *.words[1 .. * - 1];
	my @names	= [,] @lines.map: *.words[0];

	my @row = @datas.map: -> @r { @r <</>> [+] @r };
	my @col = [Z] ([Z] @datas).map: -> @c { @c <</>> [+] @c }; 
	my @all = @datas.map: -> @r { @r <</>> ([+] @datas.map(|*)) };
	
	print(@subjects,@names,@row);
	print(@subjects,@col);
	print(@subjects,@all);
}

sub print(@subjects,@data) {
	say @subjects.join("\t");
	for (@names Z @data) -> @one {
		say @one.map(|*).join("\t");
	}
}

大佬总结

以上是大佬教程为你收集整理的About Matrix全部内容,希望文章能够帮你解决About Matrix所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: