bool isnumeric( char str[] )
{ int dpt_cnt = 0; int dpt_loc = 0; int com_loc = -1; bool hascom = false;int len = (signed int)strlen( str ) + 1;
for ( int i=0; i<len; i++ ) {
if ( str[i] == ' ' ) {
if ((( i - com_loc ) != 4 ) && ( i > 3 )&& ( hascom == true )
&& ( !(dpt_loc > com_loc))) { return false;}
break;
}
if ( str[i] == '.' ) {
dpt_loc = i;
if ( ( dpt_cnt > 0 ) ||((dpt_loc - com_loc) != 4 ) &&
( hascom == true ) ) { return false;}
dpt_cnt++;
}
if ( str[i] == ',' ) {
hascom = true;
if ( ( i == 0 ) || ((( i - com_loc ) != 4 ) && ( i > 3 )) ) { return false;}
com_loc = i;
}
if (( str[i] == '-' ) && ( i > 0 )) {
return false;}
if ( int(str[i])<48 || int(str[i])>57 ) {
if (( str[i] != '.' ) && ( str[i] != '-' )
&& ( str[i] != ',' )) { return false;}
}
}
return true;}


طراحي وبسايت
دانلود کتاب طراحی الگوریتم CLRS به همراه حل مسائل