run time error for rank of a number

Please help me.I am getting run time error(sigfpe).I checked all kinds of run time error along with sigfpe. could any one help me in this regard.

the code is :

#include
using namespace std;

unsigned long long arr[18];
int ar[18],size,hash[10],la[10];

unsigned long long fact(int x){
//cout<<“h”;
int var=1;
if(x==0)return 0;
while(var<=x){
arr[var]=arr[var-1]*(var++);
}
return arr[x];
}

int store(unsigned long long id){
int i=0;
while(id>0){
ar[i++]=id%10;
id=id/10;
}
if(i==0)return 1;
return i;
}

int check(){
int lesser=0,k=size-1;//cout<<k<<“d”<<size<<“m”;
while(k>=0){
if(ar[k]<ar[size] && hash[ar[k]]==0){
la[lesser++]=ar[k];
}
hash[ar[k–]]++;
}//cout<<lesser<<“n”;
return lesser;
}

unsigned long long div(){
unsigned long long denom=1;
for(int i=0;i<10;i++){//cout<<“z”;
if(hash[i]>1){//cout<<“q”;
denom=denom*fact(hash[i]);
}
}//cout<<denom<<“v”;
return denom;
}

void hashing(){
int i=0;
while(i<10)
hash[i++]=0;
}

void rank(unsigned long long id){
unsigned long long subRank=0;
int lesser;
while(size–>0){
hashing();
lesser=check();
for(int i=0;i<lesser;i++){
hash[la[i]]–;hash[ar[size]]++;
subRank=subRank+fact(size)/div();
hash[la[i]]++;hash[ar[size]]–;
}
}
cout<<subRank+1<<endl;
}

int main(){
int i,a,num;
arr[0]=1;
unsigned long long id;
cin>>num;
while(num–){
cin>>id;
size=store(id);
hashing();
rank(id);
}
return 0;
//cin>>a;
}

//