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条回答
悬赏问题
- ¥20 关于#硬件工程#的问题,请各位专家解答!
- ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
- ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
- ¥30 截图中的mathematics程序转换成matlab
- ¥15 动力学代码报错,维度不匹配
- ¥15 Power query添加列问题
- ¥50 Kubernetes&Fission&Eleasticsearch
- ¥15 報錯:Person is not mapped,如何解決?
- ¥15 c++头文件不能识别CDialog
- ¥15 Excel发现不可读取的内容