假设“M-N"表示除以M的余数是N (N
来源:学生作业帮 编辑:大师作文网作业帮 分类:综合作业 时间:2024/11/13 21:31:56
假设“M-N"表示除以M的余数是N (N 在EXCEL的A1中有数据:“6-3,9-0,10-1,”(表示6-3,9-0,10-1在1到40内的两两交集的并集).现在要将A1中的数据转为整数输出.求VBA(EXCEL自定义函数)
上例操作过程为:6-3(在1到40内)即为“3,9,15,21,27,33,39, 9-0(在1到40内)即为“9,18,27,36,” 10-1(在1到40内)即为:1,11,21,31,” 6-3与9-0的交集为:9,27, 6-3与10-1 的交集为:21 9-0与10-1的交集没有.现在输出“9,21,27,”
上例操作过程为:6-3(在1到40内)即为“3,9,15,21,27,33,39, 9-0(在1到40内)即为“9,18,27,36,” 10-1(在1到40内)即为:1,11,21,31,” 6-3与9-0的交集为:9,27, 6-3与10-1 的交集为:21 9-0与10-1的交集没有.现在输出“9,21,27,”
Function fc(x)
Dim dic As Object, a, b%(40), i%, j%, f, aa
For j = 1 To 40: b(j) = 0: Next j
x = Replace(x, ",", ",")
x = Replace(x, "-,", "-")
a = Split(x, ",")
For i = 0 To UBound(a) - 1
aa = Split(a(i), "-")
For j = 1 To 40
If j Mod Val(aa(0)) = Val(aa(1)) Then b(j) = b(j) + 1
Next j
Next i
f = ""
For j = 1 To 40
If b(j) > 1 Then f = f & j & ","
Next j
fc = f
End Function
Dim dic As Object, a, b%(40), i%, j%, f, aa
For j = 1 To 40: b(j) = 0: Next j
x = Replace(x, ",", ",")
x = Replace(x, "-,", "-")
a = Split(x, ",")
For i = 0 To UBound(a) - 1
aa = Split(a(i), "-")
For j = 1 To 40
If j Mod Val(aa(0)) = Val(aa(1)) Then b(j) = b(j) + 1
Next j
Next i
f = ""
For j = 1 To 40
If b(j) > 1 Then f = f & j & ","
Next j
fc = f
End Function
M、N表示自然数,设SM、SN风别表示M、N个位数字之和,M#N表示M除以N所得的余数,已知M、N之和是7043.
12.M、N表示自然数,SM、SN分别表示M、N的各位数字之和,MN表示M除以N所得的余数.已知M、N之和是7043,求
一个三位数除以47,商是m,余数是n,则m+n最大值是?
n除以m的商是
“设M,N都是自然数,记P是自然数M的各位数字之和,W是自然数N的各位数字之和,又记M•N是M除以N的余数.
m整除n是指m÷n还是n÷m m除以n呢?
因式分解m(m+n)(n-m)-n(m+n)(m-n)是怎么分解的
设正整数a与m互质.证明:必存在一个正整数n使a+a的平方+...+a的n次方除以m的余数是1.
m除以n=5,m,n都是自然数,m和n的最大公因数是(),最小公倍数是()
数M除以数N的商正好是数N的倒数,数M是?
M除以N(N不等于0),并且M除以N=5,M和N的最大公因数是()?急
m和n是两个自然数,且m除以n=8(m、n均不为0),则m和n的最大公因数是?最小公倍数