#一个屋子里有一群人,如果3个人一桌多2个,5个人一桌多4个,7个人一桌多6个,9个人一桌多8个,11个人一桌正好坐满。请问这屋里一共有多少人
x = int(raw_input('please input a number:'))
def number(x):
a = []
for i in range(0, x, 11):
if i % 3 == 2 and i % 5 == 4 and i % 6 == 5 and i % 9 == 8 :
a.append(i)
print a
number(x)
SAS 实现:
data a;
do i = 0 to 10000 by 11;
if mod(i,3) = 2 and mod(i,5) = 4 and mod(i,7) = 6 and mod(i,9) = 8 then output;
end;
proc print;
run;
do i = 0 to 10000 by 11;
if mod(i,3) = 2 and mod(i,5) = 4 and mod(i,7) = 6 and mod(i,9) = 8 then output;
end;
proc print;
run;