Sum of the digits of a number (function)#9394

Sum of the digits of a number (function)

1 sekunt
64 megabaýt
Örän ýeňil

Write a function:

int suma(int n);

in C++

function suma(n: longint): longint;

in Pascal

def suma(n)

in Python

This function should return the sum of the digits of the number .

For example, for the number , the sum of the digits is .

Mysallar

1-nji mysal

Loading
Loading