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

Re:超级水题,超级代码

Posted by crazyaxe at 2012-07-12 10:17:17 on Problem 1316
In Reply To:超级水题,超级代码 Posted by:whus2010301500230 at 2011-10-28 23:26:14
#include<stdio.h>

int main()
{
    int i,num,sum,use[10001]={0};
    for(i=1;i<=10000;i++)
    {
        if(use[i]==0)
         printf("%d\n",i);
        num=i;
        sum=num;
        while(num)
        {
            sum+=num%10;
            num/=10;
        }
        if(sum<=10000)
         use[sum]=1;
    }
    return 0;
}
=.=,本来准备用这个打表的说……结果这样就过了……

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