Бодолт илгээх | Бүх бодолтууд | Шилдэг бодолтууд | Жагсаалт руу буцах |
RGB7305 - Цифрийн давталт |
Өгөгдсөн тоонд өгөгдсөн цифр хэдэн удаа орсныг ол.
Input
Нэг мөрөнд бүхэл тоо ба цифр зайгаар тусгаарлагдан өгөгдөнө.
Output
Цифр хэдэн удаа орсон тоо.
Example
Input: 23453 3 Output: 2
Нэмсэн: | 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-09-16 03:31:29
package jk; import java.util.Scanner; public class n { public static void main(String[] args) { // TODO Auto-generated method stub Scanner scan = new Scanner (System.in); System.out.print("A="); int nu1 = scan.nextInt(); System.out.print("B="); int nu2 = scan.nextInt(); // int a=0,b=0,c=0,d=0,e=0,f=0; b=b+nu1%10; if(nu1>10000) { a=nu1/10000; nu1=nu1 - a*10000; } if(nu1>1000) { c=nu1/1000; nu1=nu1-c*1000; } if(nu1>100) { d=nu1/100; nu1=nu1-d*100; } if(nu1>10) { e=nu1/10; } if(nu2==a ) { f=f+1; } if(nu2==b) { f=f+1; } if(nu2==c) { f=f+1; } if(nu2==d) { f=f+1; } if(nu2==e) { f=f+1; } System.out.print(f); } } |
||||||||
2022-06-24 11:49:28
hi |Notes:| 1. Don't post any source code here.| 2. Please be careful, leave short comments only. Don't spam here.| 3. For more discussion (hints, ideas, solutions) please visit our forum.| 4. Authors are allowed to delete the post and use html code here (e.g. to provide some useful links).| |Notes:| 1. Don't post any source code here.| 2. Please be careful, leave short comments only. Don't spam here.| 3. For more discussion (hints, ideas, solutions) please visit our forum.| 4. Authors are allowed to delete the post and use html code here (e.g. to provide some useful links).| |Notes:| 1. Don't post any source code here.| 2. Please be careful, leave short comments only. Don't spam here.| 3. For more discussion (hints, ideas, solutions) please visit our forum.| 4. Authors are allowed to delete the post and use html code here (e.g. to provide some useful links).| |
||||||||
2022-04-26 11:05:37
#include <bits/stdc++.h> using namespace std; int main(){ int m,n,b,s; cin>>n>>b; s=0; while(n>0) {m=n%10;if(m==b)s++;n=n/10;} cout<<s<<endl; return 0; }8-1 orgil |
||||||||
2022-04-14 04:50:18
#include <iostream> using namespace std; int main() { int a,i,n,pp=0; cin>>a>>n; while(a>0){ if(a%10==n) pp=pp+1; a=a/10; } cout<<pp; //ez eniig huul } |
||||||||
2022-04-05 06:28:34
#include<iostream> using namespace std; int main() { int n,m,h,b=0; cin>>n>>m; while(n>0) { h=(n%10); n=(n/10); if (h==m) b=b+1; } cout <<b; } El Arsa <33 |
||||||||
2022-03-28 15:20:56
#include <stdio.h> int main() { int n, s=0, a, b; scanf("%d%d", &n, &b); while (n>0) { a=n%10; n=n/10; if (a==b) { s=s+1;} } printf("%d", s); return 0; } porno2 |
||||||||
2022-03-15 08:51:59
#include <iostream> using namespace std; int main() { int n, s=0, a, b; cin>>n>>b; while (n>0){ a=n%10; n=n/10; if (a==b){ s=s+1; } } cout << s; return 0; } |
||||||||
2021-11-16 07:55:31
int n, a, c, b=0 ; Scanner cs = new Scanner(System.in); n = cs.nextInt(); c = cs.nextInt(); while( n>=1 ) { a=n%10; if(a==c) b=b+1; n=n/10; } System.out.print(b); |
||||||||
2019-12-21 07:40:55
#include "pch.h" #include <iostream> using namespace std; int main() { int a,b; cin >> a >> b; int d = 0; int e = 0; while (a >= 1) { d = (a % 10); if (b == d) { e = (e + 1); } a = (a / 10); } cout << e << endl; return 0; } |
||||||||
2019-12-15 15:20:12
#include<bits/sdtc++.h> using namespace std; int main(){ int s,k,n; cin>>n; s=0; while(n>0) { k=n%10; s=s+k; n=n/10; } cout<<s<<endl; return 0; } |