Digital standard wording

    #include <bits/stdc++.h>
    using namespace std;
    #define ll long  long 
    char s[20],p[20];
    int cnt;
    void solve(ll c){
        if(c<0){    
        printf("-");
        c=abs(c);
    }
          cnt  = 0;
        while(c){//为0呢 
            s[cnt++] = char(c%10)+'0';
            c/=10;
        }
        for(int i =0;i<cnt/2;i++){
            p[i] = s[i];
            s[i]  =s[cnt-1-i];
            s[cnt-1-i] = p[i];
        }
        for(int i =0;i<cnt;i++){
            printf("%c",s[i]);
            int x =cnt-1-I;
             IF (X% . 3 == 0 && the CNT-I =! . 1 ) { // standard numbers written after every 3 from a forward, 
                the printf ( " , " ); 
            } 
        } 
    } 
    int main () 
    { 
        A LL, B; 
        Scanf ( " %% LLD LLD " , & A, & B);
         IF (A + B == 0 ) { 
            the printf ( " 0 \ n- " ); 
        } 
        the else 
        Solve (A + B);
         return 0;
    }
    
        

 

Guess you like

Origin www.cnblogs.com/tingtin/p/11537358.html