03-求出一串数字中,抽取某数组成的整数

输入一串数字比如3862363,抽取3,求出3组成的数字,就是333

再比如:125302,抽取2,求出所有2组成的数字,就是22

while(num!=0){
    if(num%10==theVal){
      res = res*10+theVal;
    }
    num= num/10;
}

猜你喜欢

转载自blog.csdn.net/qq_39883358/article/details/84871498