早教吧 育儿知识 作业答案 考试题库 百科 知识分享

求个位数是6,且能被3整除的所有四位数之和

题目详情
求个位数是6,且能被3整除的所有四位数之和
▼优质解答
答案和解析
这是pascal程序
var
m,i:longint;
begin
i:=1086;m:=0从1086开始做;
repeat
if i mod 3=0 then writeln('x=',i)如果能整除3就打印;
inc(i,10); 每次加十,保证个位数是6
inc(m); 记录共有几个数满足条件
until i>9996; 直到这时停止
writeln(m);
end.
x=1086
x=1116
x=1146
x=1176
x=1206
x=1236
x=1266
x=1296
x=1326
x=1356
x=1386
x=1416
x=1446
x=1476
x=1506
x=1536
x=1566
x=1596
x=1626
x=1656
x=1686
x=1716
x=1746
x=1776
x=1806
x=1836
x=1866
x=1896
x=1926
x=1956
x=1986
x=2016
x=2046
x=2076
x=2106
x=2136
x=2166
x=2196
x=2226
x=2256
x=2286
x=2316
x=2346
x=2376
x=2406
x=2436
x=2466
x=2496
x=2526
x=2556
x=2586
x=2616
x=2646
x=2676
x=2706
x=2736
x=2766
x=2796
x=2826
x=2856
x=2886
x=2916
x=2946
x=2976
x=3006
x=3036
x=3066
x=3096
x=3126
x=3156
x=3186
x=3216
x=3246
x=3276
x=3306
x=3336
x=3366
x=3396
x=3426
x=3456
x=3486
x=3516
x=3546
x=3576
x=3606
x=3636
x=3666
x=3696
x=3726
x=3756
x=3786
x=3816
x=3846
x=3876
x=3906
x=3936
x=3966
x=3996
x=4026
x=4056
x=4086
x=4116
x=4146
x=4176
x=4206
x=4236
x=4266
x=4296
x=4326
x=4356
x=4386
x=4416
x=4446
x=4476
x=4506
x=4536
x=4566
x=4596
x=4626
x=4656
x=4686
x=4716
x=4746
x=4776
x=4806
x=4836
x=4866
x=4896
x=4926
x=4956
x=4986
x=5016
x=5046
x=5076
x=5106
x=5136
x=5166
x=5196
x=5226
x=5256
x=5286
x=5316
x=5346
x=5376
x=5406
x=5436
x=5466
x=5496
x=5526
x=5556
x=5586
x=5616
x=5646
x=5676
x=5706
x=5736
x=5766
x=5796
x=5826
x=5856
x=5886
x=5916
x=5946
x=5976
x=6006
x=6036
x=6066
x=6096
x=6126
x=6156
x=6186
x=6216
x=6246
x=6276
x=6306
x=6336
x=6366
x=6396
x=6426
x=6456
x=6486
x=6516
x=6546
x=6576
x=6606
x=6636
x=6666
x=6696
x=6726
x=6756
x=6786
x=6816
x=6846
x=6876
x=6906
x=6936
x=6966
x=6996
x=7026
x=7056
x=7086
x=7116
x=7146
x=7176
x=7206
x=7236
x=7266
x=7296
x=7326
x=7356
x=7386
x=7416
x=7446
x=7476
x=7506
x=7536
x=7566
x=7596
x=7626
x=7656
x=7686
x=7716
x=7746
x=7776
x=7806
x=7836
x=7866
x=7896
x=7926
x=7956
x=7986
x=8016
x=8046
x=8076
x=8106
x=8136
x=8166
x=8196
x=8226
x=8256
x=8286
x=8316
x=8346
x=8376
x=8406
x=8436
x=8466
x=8496
x=8526
x=8556
x=8586
x=8616
x=8646
x=8676
x=8706
x=8736
x=8766
x=8796
x=8826
x=8856
x=8886
x=8916
x=8946
x=8976
x=9006
x=9036
x=9066
x=9096
x=9126
x=9156
x=9186
x=9216
x=9246
x=9276
x=9306
x=9336
x=9366
x=9396
x=9426
x=9456
x=9486
x=9516
x=9546
x=9576
x=9606
x=9636
x=9666
x=9696
x=9726
x=9756
x=9786
x=9816
x=9846
x=9876
x=9906
x=9936
x=9966
x=9996
892 共有892个数满座条件