Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
Register

## Re:为什么老wa，很无语啊！！求高手指教（贴代码）

Posted by jean890915 at 2011-10-09 20:44:07 on Problem 1528
In Reply To:为什么老wa，很无语啊！！求高手指教（贴代码） Posted by:jean890915 at 2011-10-09 20:37:21
```> #include "iostream"
> #include "math.h"
> using namespace std;
>
> int main()
> {
> 	int i,n,sum;
>
> 	cin>>n;
> 	cout<<"PERFECTION OUTPUT"<<endl;
> 	while (n!=0)
> 	{
> 		sum = 0;
> 		for (i=2;i<=(int)sqrt(1.0*n);i++)
> 		{
> 			if (n%i == 0)
> 			{
> 				sum += i;
> 				if (i != n/i)
> 					sum += n/i;
> 			}
> 		}
> 		if (n!=1)
> 			sum += 1;
> 		if (sum == n)
> 			printf("%5d  PREEFCT\n",n);%这里perfect写错了！！！无语！！！！！！！！！
> 		else if (sum < n)
> 			printf("%5d  DEFICIENT\n",n);
> 		else
> 			printf("%5d  ABUNDANT\n",n);
> 		cin>>n;
> 	}
> 	cout<<"END OF OUTPUT"<<endl;
> 	return 0;
> }
```

Followed by: