Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
226 B
3
Indexable
Never
#include <stdio.h>
int main()
{
    int n,m,sum=0,rem;
    scanf("%d",&n);
    scanf("%d",&m);
    while (m)
    {
        rem=m%10;
        sum=sum+rem;
        m/=10;
    }
    printf("%d",sum);
    return 0;
}