某幼儿园里,有5个小朋友编号为1,2,3,4,5,他们按自己的编号顺序围坐在一张圆桌旁.

用C语言
2025-01-02 13:18:04
推荐回答(1个)
回答1:

var x1,x2,x3,x4,x5:integer;
begin
read(x1,x2,x3,x4,x5);
x1:=x1 div 3;x5:=x5+x1;x2:=x1+x2;
x2:=x2 div 3;x1:=x1+x2;x3:=x3+x2;
x3:=x3 div 3;x2:=x2+x3;x4:=x3+x4;
x4:=x4 div 3;x3:=x3+x4;x5:=x5+x4;
x5:=x5 div 5;x1:=x1+x5;x4:=x4+x5;
writeln(x1,' ',x2,' ' ,x3,' ' ,x4,' ',x5);
readln;
end.