Бодолт илгээх | Бүх бодолтууд | Шилдэг бодолтууд | Жагсаалт руу буцах |
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
|
|||||||||
2023-01-13 10:28:22
#include<stdio.h> main() { int n, c, tooluur = 0; scanf("%d%d", &n, &c); while(n>0) { if(n % 10 == c) tooluur++; n/=10; } printf("%d", tooluur); }#include<stdio.h> main() { int n, c, tooluur = 0; scanf("%d%d", &n, &c); while(n>0) { if(n % 10 == c) tooluur++; n/=10; } printf("%d", tooluur); } |
|||||||||
2022-11-17 06:30:33
uraaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
|||||||||
2022-11-17 06:28:53
pakyu saihnaaaaaaaaaaaaaaaaaaaaaaaa |
|||||||||
2022-11-17 06:19:24
huuldag suvdig men |
|||||||||
2022-11-17 04:29:02
#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; } |
|||||||||
2022-11-16 06:08:16
SUVD CHI IIM BAIJ BOLQ HUULHA BOLI |
|||||||||
2022-11-11 03:21:03
#include<stdio.h> int a,b=0,c; int main () { scanf("%d",&a); while(a>0) { if(a%10>b) b=a%10; a=a/10; } printf("%d",b); return 0; } |
|||||||||
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 |