Advertisement
Robert_Manea

cea mai mare cifra

Nov 18th, 2019
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {int s,n,c,nr,max=0;
  6. s=0;
  7. scanf("%d",&n);
  8. while(n!=0){
  9. c=n%10;
  10. if(c>max)
  11. max=c;
  12. n=n/10;
  13. if(max==c)
  14. nr++;
  15.  
  16.  
  17. }
  18. printf("%d",max);
  19.  
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement