help真的不知道我错在哪里了qwq,谢谢各位码友帮忙
#include <iostream>
using namespace std;
int judge(int n);
int count(int a,int b);
int main()
{
int t;
cin>>t;
while(t--)
{
int a,b;
cin>>a>>b;
cout<<count(a,b)<<endl;
}
return 0;
}
int count(int a,int b)
{
int i,cnt=0;
for(i=a;i<=b;i++)
{
if(judge(i)==1)
cnt++;
}
return cnt;
}
int judge(int n)
{
int sum=0,k=n,i;
for(i=1;i<=n/2;i++)
{
if(k%i==0)
{
// cout<<"i="<<i<<endl;
sum+=i;
}
}
<span class="hljs-keyword">if(sum==n)
return 1;
return 0;
}