Advertisement
damch

Najmal broj koj sodrzi M

Dec 6th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. int m,n,i,j,brdeliteli,n1,najmal=999999,pom,br;
  6. scanf("%d %d",&m,&n);
  7. for(i=0;i<n;i++)
  8. {
  9. scanf("%d",&n1);
  10. pom=n1;
  11. br=0;
  12. while(pom>0)
  13. {
  14. if(pom%10==m)
  15. br++;
  16. pom/=10;
  17. }
  18. if(br!=0&&n1<najmal)
  19. {
  20. najmal=n1;
  21. }
  22.  
  23.  
  24. }
  25. printf("%d",najmal);
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement