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

What happened with my program of 1528

Posted by zhanglinghao at 2015-06-11 21:31:07
program poj1528;
var
  n,i,sum:longint;
  a:array[1..201,1..2] of longint;
function add(a:longint):longint;
var
  i,s:longint;
begin
  s:=1;
  for i:=2 to a-1 do 
	if (a mod i=0) then s:=s+i;	
  add:=s;	
end;
  
begin
  n:=10000;  sum:=0;
  while n<>0 do
    begin
	  read(n);
	  inc(sum);
	  a[sum,1]:=n;
	  a[sum,2]:=add(n);
	end; 
  writeln('PERFECTION OUTPUT');	
  for i:=1 to sum-1 do
    begin
	  write(a[i,1]:5,'  ');
	  if a[i,2]<a[i,1] then writeln('DEFICIENT');
	  if a[i,2]=a[i,1] then writeln('PERFECT');
	  if a[i,2]>a[i,1] then writeln('ABUNDANT');
	end;
  writeln('END OF OUTPUT');	
end.


{why it always say 'Worry Answer'}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator