Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int cifri(int n)
- {
- if(n<10)
- {
- if(n<5)
- {
- printf("%d", n);
- return 1;
- }
- return 0;
- }
- int a=n%10;
- if(a<5)
- {
- int br=1+cifri(n/10);
- printf("%d",a);
- return br;
- }
- return cifri(n/10);
- }
- int main()
- {
- int i,broj,n;
- scanf("%d",&n);
- for(i=0;i<n;i++)
- {
- scanf("%d",&broj);
- printf(" : %d\n", cifri(broj));
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement