编写一个程序,求11111111111111*111111111111111的值,用数组的知识
答案:1 悬赏:40 手机版
解决时间 2021-02-08 09:00
- 提问者网友:且恨且铭记
- 2021-02-08 03:50
编写一个程序,求11111111111111*111111111111111的值,用数组的知识
最佳答案
- 五星知识达人网友:有你哪都是故乡
- 2021-02-08 04:42
my @map1 = qw(
.........OXXXX.........
.......XXXXXXXXXX......
.....XXXXX1111XXXX.....
....XXX1111111111XX....
...XX111111111111XXO...
...XX1111111111111XX...
..XX111111111111111XXO.
..XX1111111111111111XX.
.XX11111111111111111XX.
.XX11111111111111111XX.
.XX11111111111111111XXO
.XX11111111111111111XXO
.XX11111111111111111XXO
.XX11111111111111111XX.
.OXX1111111111111111XX.
..XX1111111111111111XX.
...XX11111111111111XX..
....XX111111111111XXO..
....XX111111111111XX...
.....XXX1111111XXXX....
......XXXXXXXXXXXO.....
........XXXXXXXO.......
.......................);
@map1 = map {[split //]} @map1;
my @map2 = qw(
.........XXXXX.........
.......X111X1XX1X......
.....X1111X111X11X.....
....XX1X1111111111X....
...X1X11111111X1111X...
...1XX1XX11X1X111111...
..X1X1111X1111111111XX.
..11X11XXXX11X1111111X.
.XXX1111X1111X1X11111X.
.X11111X1111111X111111.
.XXX111111X11111111111X
.XX11X1111111X1X111111X
.X11111X1111X111111111X
.X11111XX1111111X1X11X.
.XX1X111X11X111X11X11X.
..X1X111111X1X1X1XX11X.
...11111111111111XX11..
....1X111X11X11111XXX..
....X1XX1111X1111XXX...
.....XX1111111XX11X....
......X11XXX11XX1X.....
........11XXX1XX.......
.......................);
@map2 = map {[split //]} @map2;
for my $m (0 .. $#map2) {
for my $n (0 .. $#{$map2[$m]}) {
if ($map2[$m][$n] =~ /X|O/ or $map1[$m][$n] =~ /X|O/) {
print 'X';
} else {
print '1';
}
}
print "\n";
}追问看不懂怎么办啊?
.........OXXXX.........
.......XXXXXXXXXX......
.....XXXXX1111XXXX.....
....XXX1111111111XX....
...XX111111111111XXO...
...XX1111111111111XX...
..XX111111111111111XXO.
..XX1111111111111111XX.
.XX11111111111111111XX.
.XX11111111111111111XX.
.XX11111111111111111XXO
.XX11111111111111111XXO
.XX11111111111111111XXO
.XX11111111111111111XX.
.OXX1111111111111111XX.
..XX1111111111111111XX.
...XX11111111111111XX..
....XX111111111111XXO..
....XX111111111111XX...
.....XXX1111111XXXX....
......XXXXXXXXXXXO.....
........XXXXXXXO.......
.......................);
@map1 = map {[split //]} @map1;
my @map2 = qw(
.........XXXXX.........
.......X111X1XX1X......
.....X1111X111X11X.....
....XX1X1111111111X....
...X1X11111111X1111X...
...1XX1XX11X1X111111...
..X1X1111X1111111111XX.
..11X11XXXX11X1111111X.
.XXX1111X1111X1X11111X.
.X11111X1111111X111111.
.XXX111111X11111111111X
.XX11X1111111X1X111111X
.X11111X1111X111111111X
.X11111XX1111111X1X11X.
.XX1X111X11X111X11X11X.
..X1X111111X1X1X1XX11X.
...11111111111111XX11..
....1X111X11X11111XXX..
....X1XX1111X1111XXX...
.....XX1111111XX11X....
......X11XXX11XX1X.....
........11XXX1XX.......
.......................);
@map2 = map {[split //]} @map2;
for my $m (0 .. $#map2) {
for my $n (0 .. $#{$map2[$m]}) {
if ($map2[$m][$n] =~ /X|O/ or $map1[$m][$n] =~ /X|O/) {
print 'X';
} else {
print '1';
}
}
print "\n";
}追问看不懂怎么办啊?
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯