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.|

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
2019-11-07 03:55:50
#include<bits/sdtc++.h>

using namespace std;

int main(){
int m,a,b,n;

cin>>a>>b;

n=0;
while(a>0) {
m=a%10;
if(m==b) n++;
a=a/10;
}

cout<<n<<endl;

return 0;
}
2019-10-29 08:02:27
#include <iostream>

using namespace std;

int main(){
int a,b,i=0;
cin>>a>>b;
while(a>0){
if(a%10==b) i++;
a/=10;
}
cout<<i<<endl;
return 0;
} mo zariulav
2019-10-27 07:30:25
#include <cstdio>

int main () {
int a , b , l = 0;
scanf("%d %d" , &a , &b);
while(a > 0){
if(a % 10 == b){
l++;
}
a /= 10;
}
printf("%d %d" , b , i);
}
2019-10-19 13:43:03
#include <cstdio>
int main()
{
int a, s, i=0;
scanf ("%d%d", &a,&s);
while(a > 0){
if(a % 10 == s) i = i + 1;
a /= 10;
}
printf("%d", i);
}
2019-10-19 13:41:13
#include <cstdio>
int main()
{
int a, s=0;
scanf ("%d", &a);
while(a > 0){
if(a % 2 ==1) s = s + a % 2;
a /= 10;
}
printf("%d\n", s);
}
2019-10-06 08:36:31
#include <cstdio>

int main(){
int n , a;
scanf("%d%d" , &n , &a);
int s = 0;
while(n > 0){
if(n % 10 == a)s ++;
n /= 10;
}
printf("%d" , s);
}
2019-03-01 09:04:31
#include<bits/stdc++.h>
#include<math.h>
using namespace std;
main()
{ long long a,s,d,f=0;
scanf("%lld %lld",&a,&s);
while (a>0)
{ d=a%10;
a=a/10;
if(d==s) f=f+1; }
printf("%lld",f);
return 0;
}
2018-10-18 08:00:16


Last edit: 2018-10-18 08:01:29
2017-12-25 03:24:47
#include <iostream>
#include <math.h>
using namespace std;
int main(){
int a,b,c,d;
cin>>a>>b;
while(a>0){
c=a%10;
a=a/10;
if(c==b)d=d+1;
}
cout<<d;
}
2016-10-05 18:04:18
barag l bolox geed bx yumaa
import java.util.Scanner;


public class s {

public static void main(String[] args) {
Scanner r = new Scanner(System.in);
int a, f = 0, s;
a = r.nextInt();
s = r.nextInt();
if(a>0 && s>0)f=f+2;
else if(0>a||s>0)f=f+1;
else if(0<a||s<0)f=f+1;
else if(0==a&&s==0)f=0;
System.out.println(f);
}

}
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.