CodeChef::FLOW006
# include <iostream> ;
using namespace std ;
int main(){
int T ;
int sum{0} ;
cin >> T ;
int N[T] ;
for (int i = 0; i < T; ++i) {
cin >> N[i] ;
}
for (int i = 0; i < T; ++i) {
while (N[i] != 0){
sum = sum + N[i]%10 ;
N[i] = N[i]/10 ;
}
cout << sum << '\n' ;
sum = 0 ;
}
return 0 ;
}
Comments
Post a Comment