1 / 2
Nov 2011

I got wrong ans.....
What's the problem with my code ....
Please , tell me ....here's the code

include

int main()
{
unsigned long j,i,t;
scanf("%lu",&t);
unsigned long long a[t],s[t];
for(i=0;i{
scanf("%llu",&a[i]);
if(a[i]==1)
s[i]=1;
else
s[i]=1+a[i];
for(j=2; j*j<=a[i]; j++){
if(a[i]%j == 0){
if(j*j==a[i])
s[i] = s[i] + j;
else
s[i] = s[i] + j + a[i]/j ;
}
}
}
for(i=0;i printf("%llu\n",s[i]);
return 0;
}

  • created

    Nov '11
  • last reply

    Nov '11
  • 1

    reply

  • 126

    views

  • 2

    users

Suggested Topics

Topic Category Replies Views Activity
C and C++ 0 17 10d

Want to read more? Browse other topics in C and C++ or view latest topics.