⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 strround.c

📁 微软的基于HMM的人脸识别原代码, 非常经典的说
💻 C
字号:
int strround(char *s,int len)
{
    /* string rounding function
     * (c) Edmond J. Breen.
     * round back the numbers in a string
     * and fill with zeros.
     * where: 'len' is the length of the string.
     * Returns 1 on success
     * and 0 if over flow has occurred.
     */
    if(len>0)
	if(s[--len] >= '5') {
	    do {
		s[len--] = '0';
	    } while(len > 0 && s[len] == '9');
	    if(s[len] == '9')
		return 0;
	    s[len]++;
	}
    return 1;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -