Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main (int argc, const char * argv[]) {
- int n;
- scanf("%d", &n);
- int zbir = 0;
- int broj_na_cifri = 0;
- for(int x = n; x > 0; x /= 10) {
- int cifra = x % 10;
- zbir += cifra;
- broj_na_cifri++;
- }
- int sredna_vrednost = zbir / broj_na_cifri;
- for(int y = n; y > 0; y /= 10) {
- int cifra = y % 10;
- if(cifra > sredna_vrednost) {
- printf("%d ", cifra);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement