Бодолт илгээх | Бүх бодолтууд | Шилдэг бодолтууд | Жагсаалт руу буцах |
RGB7303 - Тэгш цифрүүдийн нийлбэр |
Өгөгдсөн тоон дахь тэгш цифрүүдийн нийлбэрийг ол.
Input
Бүхэл тоо өгөгдөнө.
Output
Тэгш цифрүүдийн нийлбэр.
Example
Input: 34567 Output: 10
Нэмсэн: | 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
|
|||||||||||||
2022-03-15 08:57:03
#include <iostream> using namespace std; int main() { int n, s=0, a; cin>>n; while (n>0){ a=n%10; n=n/10; if (a%2==0){ s=s+a; } } cout << s; return 0; } huul pisdaguudaa |
|||||||||||||
2022-02-15 13:52:14
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
|||||||||||||
2021-07-29 13:43:06
: < < < < < << < < < < < < < < < < < < < < < < < < < < < <<<<<<<<<<<<<<<< |
|||||||||||||
2021-03-12 09:42:53
c = a % 10; a /= 10; ene hesgiig tailbarlaad ogoocgh tnks |
|||||||||||||
2021-01-17 12:29:25
#include<iostream> using namespace std; int main() { int a,b,c; cin>>a; b=0; while(a>0) { c=a%10; if(c%2==0)b+=c; a/=10; } cout<<b; return 0; } its so ez muai huul xd |
|||||||||||||
2021-01-02 17:04:07
#include <iostream> using namespace std; int main() { int a, result, digit; cin >> a; result = 0; while( a > 0) { digit = a % 10; if( digit % 2 == 0) result += digit; a /= 10; } cout << result; return 0; } |
|||||||||||||
2020-11-21 15:56:52
main(){ int n,i,s,g,l; scanf("%d",&n); s=n; for(i=0;i<n;i++){ l=s%10; s=s/10; if((l%2)==0){ g+=l; } if(s<10){ if((s%2)==0){ g+=s; printf("%d",g); break; } else{ printf("%d",g); break; } } } } |
|||||||||||||
2020-10-30 02:43:38
#include<bits/stdc++.h> using namespace std; int main(){ int n,a,b,s=0; cin>>n; while(0<n) { a=n%10; n=n/10; if(a%2==0) s=s+a; } cout<<s; } |
|||||||||||||
2020-10-02 16:42:21
|
|||||||||||||
2020-10-02 16:41:30
|