Sum of digits for each element in vector
for ( int i = 0 ; i < a . size ( ) ; i ++ ) { int c = 0 ; while ( a . get ( i ) > 0 ) { c += ( a . get ( i ) % 10 ) ; a . set ( i , ( a . get ( i ) / 10 ) ) ; } a . set ( i , c ) ; } return a ; }