Rezultati

Up. imeNalogaJezikRezultatČas oddaje
finalsolution-2018 Sveti gral C 100/100OK 10. maj '18 @ 16:33

Test Točke Porabljen spomin Porabljen čas Status
#1 5/5 1,457 MiB 0,000 s OK
#2 5/5 1,461 MiB 0,000 s OK
#3 5/5 1,457 MiB 0,000 s OK
#4 5/5 1,461 MiB 0,000 s OK
#5 5/5 1,488 MiB 0,000 s OK
#6 5/5 1,461 MiB 0,000 s OK
#7 5/5 1,457 MiB 0,000 s OK
#8 5/5 1,484 MiB 0,000 s OK
#9 6/6 1,461 MiB 0,000 s OK
#10 6/6 1,457 MiB 0,000 s OK
#11 6/6 1,461 MiB 0,000 s OK
#12 6/6 1,461 MiB 0,000 s OK
#13 6/6 1,488 MiB 0,000 s OK
#14 6/6 1,484 MiB 0,000 s OK
#15 6/6 1,461 MiB 0,000 s OK
#16 6/6 1,461 MiB 0,000 s OK
#17 6/6 1,484 MiB 0,000 s OK
#18 6/6 1,488 MiB 0,000 s OK

Ocenjevani program (svetigral.c):
#include <stdio.h>

static int R[128];

int main() {
    int x = 0, n = 0, r = 0;
    scanf("%d", &n);
    if (n > 100) x = n - 100;
    for (; x < n; x++) {
        int a = x, s = 0;
        while (a > 0) {
            s += a % 10;
            a /= 10;
        }
        if (x + s == n) R[r++] = x;
    }
    printf("%d\n", r);
    for (x = 0; x < r; x++) printf("%d\n", R[x]);
    return 0;
}