我正在尝试创建这个程序(在python中),它将所有行转换为列,将列转换为行.
更具体地说,第一个输入是2个数字.N和M.N- 总行数,M总列数.我用过b=map(int, raw_input().split()).然后基于b[0],每个下一N行将包含M空格分隔的整数.例如:
Input:
3 5
13 4 8 14 1
9 6 3 7 21
5 12 17 9 3
Run Code Online (Sandbox Code Playgroud)
现在程序将它存储在2D数组中:
arr=[[13, 4, 8, 14, 1], [9, 6, 3, 7, 21], [5, 12, 17, 9, 3]]
Run Code Online (Sandbox Code Playgroud)
输出所需的是打印M行,每行包含N个空格分隔的整数.例如:
Output:
13 9 5
4 6 12
8 3 17
14 7 9
1 21 3
Run Code Online (Sandbox Code Playgroud)
这是我到目前为止所尝试的:
#Getting N and M from input
NM=map(int, raw_input().split()) …Run Code Online (Sandbox Code Playgroud) Metasploit工作正常,直到今天早上我更新它msfupdate,然后所有人都去了.
打字msfconsole现在给我这个错误:
Could not find nokogiri-1.6.8 in any of the sources
Run bundle install to install missing gems.
Run Code Online (Sandbox Code Playgroud)
我去打字了bundle install.直到发生这种情况一切顺利:
Installing nokogiri 1.6.8 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/usr/bin/ruby2.2 -r ./siteconf20160831-24032-1wim46x.rb extconf.rb --use-system-libraries
Using pkg-config version 1.1.7
checking if the C compiler accepts ... yes
Building nokogiri using system libraries.
checking for libxml-2.0... no
checking for libxslt... no
checking for libexslt... no
ERROR: cannot discover where libxml2 is …Run Code Online (Sandbox Code Playgroud)