-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
980c573
commit 467f868
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#include<stdio.h> | ||
|
||
int main(){ | ||
int n,a,b; | ||
scanf("%d", &n); | ||
int copy1=n; | ||
int copy2=n; | ||
while(n!=0){ | ||
int c=0; | ||
a=n%10; | ||
while(copy1!=0){ | ||
b=copy1%10; | ||
if(a==b) c++; | ||
copy1=copy1/10; | ||
} | ||
n=n/10; | ||
copy1=copy2; | ||
printf("%d is repeated %d times\n", a,c); | ||
} | ||
} |