Problem hidden
|This problem was hidden by Editorial Board member probably because it has incorrect language|version or invalid test data, or description of the problem is not clear.|

RGB7302 - Цифрүүдийн нийлбэр

Өгөгдсөн тооны цифрүүдийн нийлбэрийг ол.

Input

Натурал тоо өгөгдөнө.

Output

Цифрүүдийн нийлбэр

Example

Input:
234

Output:
9

Нэмсэн:Bataa
Огноо:2013-01-09
Хугацааны хязгаарлалт:1s
Эх кодын хэмжээний хязгаарлалт:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Програмчлалын хэлүүд:ADA95 ASM32 BASH BF C NCSHARP CSHARP C++ 4.3.2 CPP C99 CLPS LISP sbcl LISP clisp D ERL FORTRAN HASK ICON ICK JAVA JS-RHINO JULIA LUA NEM NICE OCAML PAS-GPC PAS-FPC PERL PHP PIKE PRLG-swi PYTHON PYPY3 PYTHON3 RUBY SCALA SCM guile ST TCL WHITESPACE

hide comments
2023-02-13 05:11:41
alishu
2023-01-24 14:56:42
bayrlla hamaa
2023-01-18 07:16:33
zugeer zugeer
2023-01-18 07:15:49
bayrlla hu
2023-01-18 07:12:47
#include<stdio.h>
main()
{
int n, i=n, a, s=0;
scanf("%d",&n);
for(i=n; i>0; i=i/10)
{
a=i%10;
s=s+a;
}
printf("%d",s);
}
Za huulaarai zaluusaa stdio.h deer bichsen shuu
2022-12-27 15:20:43
#include<iostream>
using namespace std;
main()
{
int n, i=n, a, s=0;
cin>>n;
for(i=n; i>0; i=i/10)
{
a=i%10;
s=s+a;
}
cout<<s;
}
2022-12-12 11:23:53
#include <iostream> { Б. Азтүшиг }
using namespace std;
int main(){
int n, i, s=0;
cin>>n;
while(n>0){
s=s+n%10;
n=n/10;
}
cout<<s;
return 0;
}
2022-11-16 05:55:26
hariult bnuu kshahkuya

2022-11-16 05:52:58
#include<bits/stdc++.h> //Barigdsa
using namespace std;
int main(){
long n,s,a;
s=0;
cin>>n;
while (n>0){
a=n%10;
s=s+a;
n=n/10;
}
cout<<s<<endl;
}
2022-11-15 04:12:51
BODOLT
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.