Cod sursa(job #3203194)

Utilizator JulyaBuhBuhai Iulia JulyaBuh Data 13 februarie 2024 11:31:16
Problema Loto Scor 0
Compilator cpp-64 Status done
Runda Teme Pregatire ACM Unibuc 2014, Anul I Marime 0.57 kb
#include <iostream>
#include <fstream>
using namespace std;

ifstream fin("loto.in");
ofstream fout("loto.out");

void loto(int numere, int suma, int aux){
    aux=0 ;
    int V[numere];
   while(!numere){
    while(V[numere]<suma && aux<=suma){
        aux=+ V[numere];
        fout<<V[numere]<<" ";
    }
    numere--;

   }
}
int main(){
    int aux;
    int numere;
    fin>>numere;

    int suma;
    fin>>suma;
     int V[numere];
     for (int i=1; i<=numere; i++){
        fin>>V[i];
     }
     loto(numere, suma, aux);
    return 0;

}