const
wq:array[1..4,1..2] of longint=((-1,0),(0,1),(1,0),(0,-1));
var
i,j,ans,tot:longint;
map:array[0..10,0..10]of longint;
s:array[0..999999]of boolean;
procedure prin(x,y,dep:longint);
var
i,x1,y1:longint;
begin
if dep=6 then begin
if not s[tot] then begin
inc(ans);
s[tot]:=true;
end;
end else for i:=1 to 4 do begin
x1:=x+wq[i,1];
y1:=y+wq[i,2];
if (x1>0) and (x1<=5) and (y1>0) and (y1<=5) then begin
tot:=tot*10+map[x1,y1];
prin(x1,y1,dep+1);
tot:=tot div 10;
end;
end;
end;
begin
for i:=1 to 5 do begin
for j:=1 to 5 do read(map[i,j]);
readln;
end;
ans:=0;
tot:=0;
for i:=1 to 5 do begin
for j:=1 to 5 do begin
tot:=tot*10+map[i,j];
prin(i,j,1);
tot:=0;
end;
end;
writeln(ans);
end.
下面的Pascal代码能帮我翻译为c++吗??
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
3条回答 默认 最新
悬赏问题
- ¥15 解决一个加好友限制问题 或者有好的方案
- ¥15 关于#java#的问题,请各位专家解答!
- ¥15 急matlab编程仿真二阶震荡系统
- ¥20 TEC-9的数据通路实验
- ¥15 ue5 .3之前好好的现在只要是激活关卡就会崩溃
- ¥50 MATLAB实现圆柱体容器内球形颗粒堆积
- ¥15 python如何将动态的多个子列表,拼接后进行集合的交集
- ¥20 vitis-ai量化基于pytorch框架下的yolov5模型
- ¥15 如何实现H5在QQ平台上的二次分享卡片效果?
- ¥30 求解达问题(有红包)