不知道你说的高效率的算法指什么,下面是一个对单个数进行操作的程序:
/* Note:Your choice is C IDE */
#include "stdio.h"
void main()
{
long n0,n1;
int ge;
printf("please input the number:\n");
scanf("%ld",&n0);
ge=n0%10;
n1=n0/10;
if(ge>=3&&ge<=7)
ge=5;
else if(ge>=8)
{
ge=0;
n1+=1;
}
else
ge=0;
n0=n1*10+ge;
printf("%ld",n0);
}