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

qing wen you shen me wen ti ma ? zen me lao shi runtime error

Posted by Be_the_top at 2009-02-23 17:27:49 on Problem 1011
#include<iostream>
using namespace std;
int main()
{   int num[63];
    while(1)
            {      int v=0, i=0, j=0, t=0;
                   scanf("%d",&v);
                   for(i=1;i<=v;i++){
                                     scanf("%d",&num[i]);
                                     t=num[i]+t;      
                                     if(num[i]>j)
                                     j=num[i];
                                     if(num[i]==0)
                                     break;
                                     }
                    for(i=j;i<=t;i++){
                                      if(t%i==0)
                                      break;
                                      }
                    printf("%d\n",i);
             }
}

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