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
2025-07-07 06:01:17
#include<iostream>
#include<cmath>
using namespace std;
int main() {
int a,s=0;
cin>>a;
while (a>0){
s=s+a%10;
a/=10;
}


cout << s;
}
2025-03-18 07:25:46
#include <stdio.h>

int main() {
int n;
scanf("%d", &n);
int sum = 0;
while (n > 0) {
sum += n % 10;
n /= 10;
}
printf("%d\n", sum);
return 0;
}

2025-02-19 02:54:54
yjhkhkyuk


Last edit: 2025-02-19 02:55:15
2025-02-14 03:35:56
‹¯0
2025-02-14 03:35:22
MZMZMZMZMZMZMZ
2025-02-13 02:48:57
teneg pisda nar
2025-02-05 02:46:18
#include<iostream>
using namespace std;
int main ()
{
int a,b;
b=0;
cin>>a;
while (a>0){
b=b+a%10;
a=a/10;
}
cout<<b;
return 0;
}
2025-02-04 02:36:38
z

Last edit: 2025-02-04 02:38:25
2025-01-19 05:29:18
#include<iostream>
using namespace std;
int main ()
{
int a,b;
b=0;
cin>>a;
while (a>0){
b=b+a%10;
a=a/10;
}
cout<<b;
return 0;
}//zzo amjilt bro
2024-11-26 23:07:05
#include <iostream>
using namespace std;

int main() {

int n,s=0;
cin >> n;
while(n>0){
s=s+n%10;
n=n/10;
}
cout<<s;
//ryuu bol gci
}
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.