Rezultati

Up. imeNalogaJezikRezultatČas oddaje
malitip Sveti gral C++ 100/100OK 10. maj '18 @ 17:21

Test Točke Porabljen spomin Porabljen čas Status
#1 5/5 3,129 MiB 0,004 s OK
#2 5/5 2,996 MiB 0,004 s OK
#3 5/5 2,996 MiB 0,004 s OK
#4 5/5 3,125 MiB 0,004 s OK
#5 5/5 3,125 MiB 0,004 s OK
#6 5/5 3,129 MiB 0,000 s OK
#7 5/5 3,133 MiB 0,004 s OK
#8 5/5 3,129 MiB 0,004 s OK
#9 6/6 3,129 MiB 0,004 s OK
#10 6/6 2,996 MiB 0,004 s OK
#11 6/6 3,125 MiB 0,004 s OK
#12 6/6 3,133 MiB 0,004 s OK
#13 6/6 2,996 MiB 0,000 s OK
#14 6/6 2,996 MiB 0,004 s OK
#15 6/6 3,129 MiB 0,004 s OK
#16 6/6 3,125 MiB 0,004 s OK
#17 6/6 3,129 MiB 0,000 s OK
#18 6/6 3,129 MiB 0,000 s OK

Ocenjevani program (main.cpp):
#include <iostream>

using namespace std;

int main()
{
    int i,a,s,z,n,st=0;
    cin>>n;
    int tab[200];

    for(i=max(0,n-100);i<n;i++){
        a=i;s=i;
        while(a>0){
            z=a%10;
            a-=z;
            s+=z;
            a/=10;
        }
        if(s==n){
            tab[st]=i;
            st++;
        }
    }



    cout << st << endl;
    for(i=0;i<st;i++) cout << tab[i] << endl;
    return 0;
}