为什么是runtime error?
网上也找不到相关的代码。。。

郁闷 高手看了回复下哈
#include <iostream>
#include 
<vector>
#include 
<string>
#include 
<math.h>
#include 
<iomanip>
#include 
<stdlib.h>
#include 
<algorithm>
using namespace std;

int pround(float f)
{
    
float eps=0.49;
    
int i=(int)f;
    
if((f-(float)i)<eps)
        
return i;
    
else 
        
return i+1;
}


int main()
{
    
float sumall=0,fat=0;
    
int i=0,percent=0;float sum=0;
    
char input[1000][1000];bool end=false;
    
while (1)
    
{
        
int temp,len;
        scanf(
"%s",input[i]);
        
if (strcmp(input[i],"-")==0&&end==true)
             
break;
        end
=false;
        
if (strcmp(input[i],"-")==0)
        
{
            
float per=fat*100/sumall;
            printf(
"%d",pround(per));
            printf(
"%%\n");
            sumall
=0;fat=0;
            end
=true;
            
continue;
        }

        len
=strlen(input[i]);
        sscanf(input[i],
"%d",&temp);        
        
if (input[i][len-1]=='c')
        
{
            sum
+=temp;
            
if (i%5==0)
            
{
               fat
+=temp;
            }

        }

        
else if (input[i][len-1]=='g')
        
{
            
if (i%5==0)
            
{
                sum
+=temp*9;
                fat
+=temp*9;
            }

            
else if (i%5==4)
            
{
                sum
+=temp*7;
            }

            
else
            
{
                sum
+=temp*4;
            }

        }

        
else if (input[i][len-1]=='%')
        
{
            
if (temp>100)
               
break;
            percent
+=temp;
        }

        
if (i%5==4)
        
{
            
if (percent!=0)
            
{
                sum
=sum*100/(float)(100-percent);
                len
=strlen(input[i-4]);
                
if(input[i-4][len-1]=='%')
                
{
                    sscanf(input[i
-4],"%d",&temp);
                    fat
+=temp*sum/100.0;
                }

            }

            sumall
+=sum;
            sum
=0;percent=0;
        }

        i
++;
    }

}