自訂格式問題-如何將右起數五個數字前面加上冒號

我想將一列數字自訂成想要的格式

EX:123456要變成1:23456

將右起數五個數字,前面加上冒號。

又EX:1445932要變成14:45932

請問該怎麼設定呢??

2 Answers

Rating
  • 1 decade ago
    Favorite Answer

    =CONCATENATE(MID(A1,1,LEN(A1)-5), ":", RIGHT(A1,5))

    Source(s): 我的腦袋瓜
  • 1 decade ago

    大致上是如此啦

    請參考看看摟

    #include<iostream>

    using namespace std;

    void change(int a){

    int count=0,change[50];

    while(a/10>0){

    change[count]=a%10;

    count++;

    a/=10;

    }

    change[count]=a;

    for(int i=count;i>=0;i--){

    if(i==4)

    cout<<":"<<change[i];

    else

    cout<<change[i];

    }

    }

    int main(void){

    int number=0;

    cin>>number;

    change(number);

    return 0;

    }

    Source(s): 自己
Still have questions? Get your answers by asking now.