Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main(){
- int x = 345;
- int najgolema_cifra = 0; // 5
- while(x > 0) { // 3
- int cifra = x % 10; // 3
- x /= 10;
- if(cifra > najgolema_cifra) {
- najgolema_cifra = cifra;
- }
- }
- printf("%d\n", najgolema_cifra);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement