s är boolean, dvs s=1 är true, s=0 är false t=0 s=0 a=0 Så länge x>=t{ if t=x then s=1 öka a addera a till t }