do{
scanf("%d", &s);
}while(s<0 || s>=10000);
if ( s == 0 ) { return 0; }