int len=strlen(str);
n=(n<len)?n:len;
char * p=new char[n+1];
////////////////////////////////////////

int m=0;
while(m<n&&str[m]!='\0')
      m++;
char * p=new char[m+1];
//////////////////////////////////////////

int digitd=1;
while(n/=10)
digitd++;
//计算总位数(取某串数字的前N位数字)

ct=digitd-ct;
while(ct--)
n/=10;
return n;
///////////////////////////总位数减去需要得到位数,求得需要位数数的值

相关文章:

  • 2021-10-03
  • 2021-12-27
  • 2022-12-23
  • 2022-12-23
  • 2021-12-18
  • 2021-08-31
  • 2021-12-18
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-09-02
  • 2021-08-02
  • 2022-12-23
  • 2021-07-15
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案