[RISOLTO, C++] Programma C++ con classi non funziona bene.

Messaggioda Daniele_97 » 20/01/2019, 20:20

Se mando in run il programma che ho copiato in calce con 1000 utenti anziche con 100(cioè mettendo #define Nut 1000 anzichè 100) mi da questo messaggio
process returned -1073741571(0xC00000FD)
Qualcuno mi sa dire cosa devo correggere per farlo funzionare correttamente? Con 100 utenti (con #define Nut 100) funziona bene.
#include <stdio.h>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <iomanip>
#include <fstream>
#include <cmath>
#define Nt 1000
#define Nut 100

using namespace std;
class Utente{

public:
Utente(){ NumeroDiTransazioni[Nut]={0};
float Reliability_value[Nut]={0};
Trust_value[Nut]={0.0};
Reputation=0.5;
cheat=false;};

void Aggiorna_reliability(int&n, float&a,float&b){//a e' il feedback, b e' il valore
Reliability_value[n]=(Reliability_value[n]*NumeroDiTransazioni[n]+pow(a,1/b))/(NumeroDiTransazioni[n]+1);
//la reliability e'uguale alla reliability vecchia moltiplicata per il numero delle transazioni precedenti
//piu' la radice valore del feed , tutto diviso il numero delle
//transazioni contando quella corrente
NumeroDiTransazioni[n]++;}

void Aggiorna_reputation(float&a,float&b,float c/*reputaz recensore,compratore*/){if (c<0.5)Reputation=Reputation*(1-pow(c,3))+a*pow(c,3);
else Reputation=Reputation*(1-pow(c,2))+pow(c,2)*a;}
void Aggiorna_trust(float a,float b,int q){Trust_value[q]=0.5*a +0.5*b;}

float get_rep(){return Reputation;}

float get_rel(int a){return Reliability_value[a];}

void imbroglione(){cheat=true;}

private:
int NumeroDiTransazioni[Nut];/*tengo conto del numero di transazioni che ogni utente ha effettuato con ciascuno degli altri*/
float Reliability_value[Nut];/*Valore di reliability*/
float Trust_value[Nut];
float Reputation;
bool cheat;
};



int main()
{ Utente V[Nut];
int A[Nt]={0},B[Nt]={0};
float C[Nt]={0},D[Nt]={0};

ifstream file400("transaction1.dat", ios::in);if(!file400){cerr<<"File Transaction.dat could not be opened"<<endl; system("pause");exit(1);}

for(int i=0;i<Nt;i++)
file400>>A[i]>>B[i]>>C[i]>>D[i];
file400.close();

for(int i=0;i<Nt;i++){
V[A[i]].Aggiorna_reliability(B[i],D[i],C[i]);
V[B[i]].Aggiorna_reputation(D[i]/*feed*/,C[i]/*valore*/,V[A[i]].get_rep()/*reputazione del compratore che recensisce*/);
V[A[i]].Aggiorna_trust(V[B[i]].get_rep()/*reputazione di B[i]*/,V[A[i]].get_rel(B[i])/*reliability di A[i] verso B[i]*/,B[i] );}

for (int i=0;i<Nut;i++)
if(V[i].get_rep()<0.5)
{V[i].imbroglione();
cout<<i<<endl;}

return 0;
}
Ultima modifica di Daniele_97 il 27/01/2019, 14:45, modificato 1 volta in totale.
Daniele_97
Junior Member
Junior Member
 
Messaggio: 29 di 102
Iscritto il: 10/12/2016, 19:38

Re: [C++] Programma C++ con classi non funziona bene.

Messaggioda Raptorista » 20/01/2019, 22:44

Ciao, indenta il codice e mettilo nell'ambiente apposito per facilitarne la lettura, così è proprio difficile da leggere.
Un matematico ha scritto:... come mia nonna che vuole da anni il sistema per vincere al lotto e crede che io, in quanto matematico, sia fallito perché non glielo trovo


Immagine
Avatar utente
Raptorista
Moderatore
Moderatore
 
Messaggio: 5166 di 9616
Iscritto il: 28/09/2008, 19:58

Re: [C++] Programma C++ con classi non funziona bene.

Messaggioda Daniele_97 » 20/01/2019, 23:15

Codice:
#include <stdio.h>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <iomanip>
#include <fstream>
#include <cmath>
#define Nt 1000
#define Nut 100

using namespace std;

      class Utente{
                        public:
                        Utente(){ NumeroDiTransazioni[Nut]={0};
                        float Reliability_value[Nut]={0};
                        Trust_value[Nut]={0.0};
                        Reputation=0.5;
                        cheat=false;};

        void Aggiorna_reliability(int&n, float&a,float&b){
        Reliability_value[n]=(Reliability_value[n]*NumeroDiTransazioni[n]+pow(a,1/b))/(NumeroDiTransazioni[n]+1);
        NumeroDiTransazioni[n]++;}

                        void Aggiorna_reputation(float&a,float&b,float c){
                        if (c<0.5)Reputation=Reputation*(1-pow(c,3))+a*pow(c,3);
                        else Reputation=Reputation*(1-pow(c,2))+pow(c,2)*a;}

                  void Aggiorna_trust(float a,float b,int q){Trust_value[q]=0.5*a +0.5*b;}

    float get_rep(){return Reputation;}

    float get_rel(int a){return Reliability_value[a];}

    void imbroglione(){cheat=true;}

    private:
    int NumeroDiTransazioni[Nut];
    float Reliability_value[Nut];
    float Trust_value[Nut];
    float Reputation;
    bool  cheat;
                                                                  };



                        int main()
                        {   Utente V[Nut];
                        int A[Nt]={0},B[Nt]={0};
                        float C[Nt]={0},D[Nt]={0};

                         ifstream file400("transaction1.dat", ios::in);if(!file400){cerr<<"File Transaction.dat could not be opened"<<endl; system("pause");exit(1);}

    for(int i=0;i<Nt;i++)
    file400>>A[i]>>B[i]>>C[i]>>D[i];
    file400.close();

   for(int i=0;i<Nt;i++){
   V[A[i]].Aggiorna_reliability(B[i],D[i],C[i]);
   V[B[i]].Aggiorna_reputation(D[i]/*feed*/,C[i]/*valore*/,V[A[i]].get_rep());
   V[A[i]].Aggiorna_trust(V[B[i]].get_rep()/*reputazione di B[i]*/,V[A[i]].get_rel(B[i])/*reliability di A[i] verso B[i]*/,B[i] );}

                        for (int i=0;i<Nut;i++)
                        if(V[i].get_rep()<0.5)
                        {V[i].imbroglione();
                        cout<<i<<endl;}

    return 0;
}
Daniele_97
Junior Member
Junior Member
 
Messaggio: 30 di 102
Iscritto il: 10/12/2016, 19:38

Re: [C++] Programma C++ con classi non funziona bene.

Messaggioda Raptorista » 20/01/2019, 23:19

Non mi sembra che tu abbia fatto il minimo sforzo per indentare questo codice :S
Senza file di input non si può riprodurre il problema. Hai provato a usare un debugger? Che cosa succede?
Inoltre, ti consiglierei di scriverlo in vero C++, cioè usando constexpr e vector anziché #define e array, se conosci queste cose.
Un matematico ha scritto:... come mia nonna che vuole da anni il sistema per vincere al lotto e crede che io, in quanto matematico, sia fallito perché non glielo trovo


Immagine
Avatar utente
Raptorista
Moderatore
Moderatore
 
Messaggio: 5167 di 9616
Iscritto il: 28/09/2008, 19:58

Re: [C++] Programma C++ con classi non funziona bene.

Messaggioda Daniele_97 » 21/01/2019, 00:11

Scusamii, non ho mai indentato bene un codice, grazie per i consigli :D
Daniele_97
Junior Member
Junior Member
 
Messaggio: 31 di 102
Iscritto il: 10/12/2016, 19:38

Re: [C++] Programma C++ con classi non funziona bene.

Messaggioda Raptorista » 21/01/2019, 00:25

Per questa volta, e questa volta soltanto, ho indentato io il tuo codice. Ci sono editor di testo che ti aiutano indentando automaticamente il codice, prova a usare uno di quelli.

Confronta il codice che hai scritto tu con il seguente
Codice:
#include <stdio.h>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <iomanip>
#include <fstream>
#include <cmath>
#define Nt 1000
#define Nut 100

using namespace std;

class Utente
{
public:
    Utente()
    {
        NumeroDiTransazioni[Nut] = {0};
        float Reliability_value[Nut] = {0};
        Trust_value[Nut] = {0.0};
        Reputation = 0.5;
        cheat = false;
    }

    void Aggiorna_reliability(int& n, float& a,float& b) //a e' il feedback, b e' il valore
    {
        // la reliability e' uguale alla reliability vecchia
        // moltiplicata per il numero delle transazioni precedenti
        // piu' la radice valore del feed , tutto diviso il numero delle
        // transazioni contando quella corrente
        Reliability_value[n] = (Reliability_value[n]*NumeroDiTransazioni[n]+pow(a,1/b))/(NumeroDiTransazioni[n]+1);
       
        NumeroDiTransazioni[n]++;
    }

    void Aggiorna_reputation(float& a, float& b, float c /*reputaz recensore,compratore*/)
    {
        if (c < 0.5)
            Reputation = Reputation*(1-pow(c,3))+a*pow(c,3);
        else
            Reputation = Reputation*(1-pow(c,2))+pow(c,2)*a;
    }

    void Aggiorna_trust(float a, float b, int q)
    {
        Trust_value[q] = 0.5*a +0.5*b;
    }

    float get_rep()
    {
        return Reputation;
    }

    float get_rel(int a)
    {
        return Reliability_value[a];
    }

    void imbroglione()
    {
        cheat = true;
    }

private:
    /* tengo conto del numero di transazioni che
     * ogni utente ha effettuato con ciascuno degli altri*/
    int NumeroDiTransazioni[Nut];
     /*Valore di reliability*/
    float Reliability_value[Nut];
    float Trust_value[Nut];
    float Reputation;
    bool cheat;
};

int main()
{
    Utente V[Nut];
    int A[Nt] = {0};
    int B[Nt] = {0};
    float C[Nt] = {0};
    float D[Nt] = {0};

    ifstream file400("transaction1.dat", ios::in);
    if(!file400)
    {
        cerr<<"File Transaction.dat could not be opened"<<endl;
        exit(1);
    }

    for(int i = 0; i < Nt; i++)
        file400 >> A[i] >> B[i] >> C[i] >> D[i];
    file400.close();

    for(int i = 0; i < Nt; i++)
    {
        V[A[i]].Aggiorna_reliability(B[i],D[i],C[i]);
        V[B[i]].Aggiorna_reputation(
                D[i] /*feed*/,
                C[i] /*valore*/,
                V[A[i]].get_rep() /*reputazione del compratore che recensisce*/);
        V[A[i]].Aggiorna_trust(
                V[B[i]].get_rep() /*reputazione di B[i]*/,
                V[A[i]].get_rel(B[i]) /*reliability di A[i] verso B[i]*/,
                B[i]);
    }

    for (int i = 0; i < Nut; i++)
    {
        if(V[i].get_rep() < 0.5)
        {
            V[i].imbroglione();
            cout << i << endl;
        }
    }

    return 0;
}

Non ti sembra più leggibile? Osserva in particolare gli spazi e gli "a capo".

Tornando al tuo problema, senza input è difficile dire qualcosa.
Un matematico ha scritto:... come mia nonna che vuole da anni il sistema per vincere al lotto e crede che io, in quanto matematico, sia fallito perché non glielo trovo


Immagine
Avatar utente
Raptorista
Moderatore
Moderatore
 
Messaggio: 5168 di 9616
Iscritto il: 28/09/2008, 19:58

Re: [C++] Programma C++ con classi non funziona bene.

Messaggioda Daniele_97 » 21/01/2019, 00:57

Il file da prendere in input contiene questi numeri nel caso di #define Nut 100, grazie mille per aver indentato correttamente il codice
37 48 0.73 0.51
85 43 0.87 0.7
50 27 0.67 0.8
31 48 0.45 0.74
93 81 0.57 0.53
70 19 0.58 0.68
79 80 0.34 0.7
91 85 0.7 0.75
51 45 0.72 0.99
97 23 0.49 0.89
45 97 0.76 0.58
48 10 0.29 0.69
31 61 0.36 0.86
84 68 0.98 0.79
7 3 0.87 0.04
92 12 0.04 0.53
59 27 0.85 0.92
96 46 0.93 0.95
12 75 0.08 0.75
39 73 0.51 0.76
15 80 0.32 0.88
33 19 0.2 0.91
59 18 0.94 0.96
74 96 0.9 0.59
45 95 0.23 0.81
73 87 0.89 0.89
27 21 0.14 0.52
35 68 0.12 0.58
5 16 0.75 0.43
81 48 0.41 0.88
71 17 0.76 0.77
53 21 0.34 0.52
45 41 0.18 0.68
26 59 0.68 0.85
82 51 0.95 0.63
35 28 0.31 0.67
78 33 0.57 0.73
21 69 0.62 0.9
91 72 0.54 0.6
42 3 0.76 0.3
39 73 0.12 0.8
10 11 0.73 0.62
85 64 0.14 0.58
33 57 0.37 0.94
56 21 0.06 0.86
43 65 0.67 0.56
19 78 0.21 0.57
19 65 0.95 0.74
96 87 0.48 0.68
85 24 0.75 0.59
60 86 0.13 0.85
60 59 0.32 0.91
12 51 0.29 0.74
4 55 1 0.15
35 84 0.27 0.56
29 96 1 0.84
94 98 0.66 0.87
75 89 0.88 0.58
79 55 0.85 0.7
76 46 0.18 0.77
71 46 0.24 0.93
29 28 0.72 0.88
71 26 0.9 0.96
49 92 0.55 0.7
31 7 0.24 0.16
0 97 0.67 0.24
62 0 0.99 0.14
73 29 0.8 0.81
67 87 0.41 0.95
4 44 0.99 0.37
40 88 0.89 0.63
89 85 0.98 0.58
85 6 0.45 0.35
84 39 0.99 0.93
81 68 0.17 0.71
43 58 0.03 0.72
22 70 0.47 0.61
87 99 0.19 0.99
68 14 0.26 0.5
23 7 0.64 0.35
18 99 0.74 0.75
79 48 0.64 0.52
57 93 0.94 0.91
78 83 0.89 0.58
70 83 0.77 0.74
61 56 0.33 0.96
32 63 0.52 0.98
26 93 0.16 0.51
72 50 0.91 0.67
5 24 0.47 0.12
20 29 0.77 0.8
34 29 0.06 0.83
65 61 0.69 0.64
13 52 0.07 0.67
93 48 0.53 0.96
1 21 0.32 0.03
9 38 0.36 0.06
14 3 0.31 0.2
23 17 0.91 0.91
68 83 0.27 0.8
38 30 0.86 0.9
61 92 0.69 0.93
25 6 0.06 0.13
90 65 0.48 0.74
68 0 0.63 0.12
91 24 0.85 0.58
67 49 0.98 0.8
98 79 0.06 0.72
40 0 0.51 0.34
88 18 0.57 0.59
86 18 0.14 0.66
96 70 0.66 0.75
72 21 0.39 0.58
50 33 0.75 0.99
30 5 0.19 0.27
13 43 1 0.68
1 68 0.52 0.18
42 38 0.24 1
46 95 0.96 0.77
87 88 0.51 0.51
95 42 0.45 0.65
41 40 0.54 0.78
14 53 0.01 0.64
34 12 0.31 0.66
36 18 0.88 0.93
7 70 0.52 0.47
31 28 0.34 0.61
67 70 0.34 0.73
60 58 0.77 0.94
42 62 0.62 0.95
62 76 0.27 0.5
75 58 0.42 0.78
41 53 0.26 0.53
95 64 0.64 0.78
44 96 0.07 0.67
68 73 0.62 0.69
35 48 0.99 0.81
71 83 0.64 0.86
70 15 0.68 0.93
22 85 0.72 0.8
60 99 0.51 0.75
18 6 0.69 0.41
68 32 0.42 0.65
58 22 0.83 0.59
40 11 0.78 0.88
2 94 0.97 0.24
49 30 0.01 0.75
90 72 0.89 0.58
53 62 0.92 0.69
88 86 0.19 0.74
77 88 1 0.51
69 79 0.84 1
11 68 0.64 0.52
17 53 0.56 0.55
25 65 0.17 0.58
62 33 0.29 0.91
32 75 0.7 1
17 32 0.5 0.74
18 36 0.76 0.5
66 8 0.39 0.13
65 91 0.37 0.9
55 22 0.47 0.5
41 52 0.2 0.76
84 50 0.9 0.65
22 18 0.98 0.56
46 74 0.41 0.73
59 35 0.61 0.59
43 79 0.51 0.81
68 40 0.88 0.62
95 98 0.95 0.77
89 42 0.85 0.68
3 44 0.08 0.13
61 26 0.27 0.78
17 78 0.57 0.94
16 63 0.22 0.79
65 94 0.37 0.77
1 26 0.83 0.4
43 49 0.32 0.62
73 9 0.85 0.44
63 71 0.79 0.96
42 25 0.86 0.55
71 14 0.62 0.96
53 50 0.91 0.82
61 99 0.25 0.6
65 83 0.25 0.5
74 14 0.09 0.99
17 75 0.35 0.67
76 22 0.24 0.97
2 21 0.51 0.45
81 88 0.9 0.79
51 49 0.05 0.71
21 0 0.59 0.05
70 61 0.08 0.75
92 67 0.47 0.66
94 85 0.28 0.52
50 95 0.95 0.82
95 11 0.92 0.95
53 41 0.9 0.53
36 64 0.23 0.99
39 45 0.97 1
13 1 0.66 0.25
37 18 0.22 0.84
54 70 0.61 0.64
29 88 0.55 0.57
59 75 0.13 0.91
57 52 0.23 0.95
57 18 0.68 0.9
41 88 0.52 0.67
71 91 0.31 0.71
77 80 0.25 0.83
2 48 0.95 0.33
53 70 0.39 0.94
12 81 0.12 0.63
96 39 0.55 0.67
38 89 0.13 1
17 80 0.11 0.97
39 78 0.63 0.79
85 5 0.62 0.07
23 21 0.13 0.52
30 13 0.27 0.97
56 84 0.09 0.81
73 52 0.88 0.71
92 7 0.78 0.07
22 44 0.3 0.66
24 28 0.13 0.72
59 13 0.06 0.93
15 83 0.19 0.87
97 25 0.81 0.65
73 26 0.41 0.89
22 12 0.11 0.98
5 57 0.51 0.34
12 9 0.64 0.14
52 55 0.22 0.68
68 60 0.93 0.84
64 39 0.97 0.64
92 17 0.77 0.8
65 1 0.56 0.34
10 11 0.57 0.98
23 39 0.8 0.83
6 35 0.97 0.05
30 64 0.14 0.65
45 37 0.22 0.65
32 56 0.89 0.77
52 71 0.36 0.91
79 54 0.63 0.62
69 77 0.45 0.9
32 13 0.92 0.89
94 90 0.11 0.74
14 47 0.7 0.85
88 77 0 0.61
69 49 0.19 0.69
14 5 0.18 0.33
11 21 0.93 0.71
31 42 0.75 0.52
6 86 0.95 0.34
91 9 0.2 0.33
8 80 0.98 0.25
95 76 0.14 0.57
37 53 0.94 0.62
44 72 0.29 0.55
41 21 0.25 0.59
92 5 0.52 0.3
32 55 0.13 0.71
49 66 0.35 0.89
32 26 0.81 0.6
28 38 0.07 0.78
14 93 0.17 0.76
12 64 0.43 0.96
97 28 0.35 0.51
16 3 0.6 0.28
78 69 0.25 0.66
84 67 0.94 0.74
58 3 0.66 0.14
85 3 0.69 0.12
95 42 0.78 0.82
80 72 0.06 0.53
23 68 0.14 0.72
63 44 0.76 0.65
31 29 0.7 0.82
81 61 0.48 0.57
2 13 0.8 0.38
56 10 0.85 0.86
56 97 0.55 0.53
50 29 0.21 0.68
47 54 0.22 0.72
93 40 0.55 0.76
25 26 0.81 0.81
50 59 0.97 0.72
0 77 0.84 0.45
39 72 0.28 0.87
57 73 0.63 0.88
17 36 0.49 0.93
41 86 0.36 0.77
3 35 0.12 0.46
43 67 0.09 0.73
8 83 0.76 0.36
0 75 0.87 0.03
57 5 0.56 0.19
70 4 0.23 0.08
45 59 0.33 0.92
66 16 0.27 0.65
79 44 0.79 0.63
85 79 0.62 0.71
32 51 0.22 0.69
3 98 0.22 0.11
34 25 0.23 1
87 80 0.63 0.91
62 6 0.61 0.45
60 15 0.6 0.65
82 25 0.5 0.71
32 79 0.75 0.62
0 25 0.89 0.15
87 32 0.27 0.83
62 88 0.04 0.56
80 7 0.31 0.36
28 55 0.03 0.67
44 61 0.33 0.62
96 92 0.38 0.5
67 20 0.89 0.75
95 50 0.29 0.65
11 78 0.44 0.63
17 0 0.49 0.34
14 81 0.02 0.91
17 52 0.09 0.64
80 40 0.92 0.74
18 95 0.81 0.5
99 17 0.1 0.94
94 33 0.73 0.79
88 4 0.22 0.41
42 16 0.18 0.78
80 58 0.5 0.67
39 82 0.32 0.51
88 46 0.87 0.89
18 58 0.08 0.91
47 39 0.45 0.64
21 95 0.39 0.6
75 44 0.1 0.81
89 19 0.22 0.65
43 54 0.02 0.63
42 97 0.86 0.71
19 14 0.71 0.94
66 44 0.26 0.77
38 61 0.51 0.96
82 14 0.75 0.65
63 70 0.54 0.69
95 1 0.22 0.06
85 0 0 0.25
14 90 0.28 0.94
80 57 0.94 0.98
92 5 0.08 0.46
53 68 0.94 0.97
15 63 0.6 0.55
70 35 0.33 0.65
95 80 0.39 0.96
84 34 0.08 0.95
78 45 0.43 0.74
26 19 0.02 0.62
86 18 0.28 0.68
83 96 0.94 1
69 32 0.9 0.55
59 8 0.52 0.02
25 16 0.22 0.83
33 83 0.15 0.61
69 84 0.39 0.81
14 85 0.95 0.91
55 3 0.28 0.28
39 95 0.85 0.57
21 11 0.13 0.96
37 47 0.64 0.83
67 58 0.79 0.64
84 32 0.05 0.56
26 90 0.19 1
53 28 0.26 0.67
35 13 0.24 0.74
43 92 0.68 0.7
58 94 0.06 0.97
42 87 0.28 0.54
24 90 0.84 0.97
11 99 0.08 0.62
5 75 0.34 0.45
86 15 0.03 0.95
75 24 0.82 0.98
72 3 0.08 0
85 3 0.14 0.03
49 20 0.22 0.96
76 2 0.9 0.06
84 41 0.73 0.85
86 92 0.36 0.65
58 63 0.22 0.58
82 13 0.81 0.6
50 61 0.62 0.98
89 25 0.08 0.79
11 16 0.3 0.97
56 85 0.58 0.91
9 61 0.61 0.14
72 23 0.72 0.63
60 30 0.38 0.5
85 47 0.36 0.95
36 73 0.87 0.62
55 37 0.41 0.56
20 25 0.66 0.79
24 20 0.45 0.93
66 39 0.82 0.6
88 47 0.43 0.57
85 22 0.09 0.97
39 54 0.76 0.76
31 60 0.88 0.56
55 49 0.33 0.91
7 28 0.84 0.47
85 19 0.8 0.84
68 34 0.33 0.71
33 14 0.54 0.85
55 13 0.13 0.57
63 93 0.38 0.74
52 42 0.36 0.51
96 51 0.15 0.87
32 76 0.91 0.88
51 93 0.88 0.82
19 2 0.65 0
83 5 0.74 0.02
88 24 0.4 0.88
88 12 0.86 0.94
91 1 0.06 0.41
42 5 0.07 0.22
18 95 0.52 0.92
19 63 0.33 0.53
72 63 0.93 0.82
92 71 0.21 0.97
61 29 0.15 0.8
16 95 0.45 0.95
1 50 0.6 0.42
80 64 0.16 0.7
60 24 0.84 0.5
84 69 0.32 0.69
55 24 0.88 0.52
48 34 0.65 0.74
58 38 0.36 0.57
84 6 0.63 0.47
45 15 0.86 0.71
61 93 0.79 0.68
63 73 0.21 0.78
34 67 0.84 0.7
73 67 0.43 0.79
36 99 0.76 0.56
40 89 0.74 0.73
66 61 0.76 0.85
67 90 0.05 0.72
70 37 0.21 0.98
78 45 0.33 0.64
89 61 0.85 0.62
41 67 0.24 0.58
3 23 0.47 0.2
14 20 0.5 0.84
25 52 0.58 0.59
23 1 0.18 0.36
81 26 0.09 0.78
33 80 0.49 0.81
62 39 0.87 0.67
88 32 0.77 0.92
53 40 0.13 0.76
64 37 0.32 1
89 27 0.65 0.89
13 74 0.7 0.63
0 38 0.17 0.27
4 15 0.18 0.46
92 38 0.26 0.72
85 71 0.5 0.56
59 72 0.51 0.89
87 42 0.82 0.85
79 47 0.99 0.84
82 32 0.56 0.85
58 31 0.51 0.62
8 52 0.24 0.4
15 72 0.49 0.6
16 22 0.24 0.61
80 50 0.34 0.82
58 37 0.6 0.82
46 50 0.96 0.67
86 30 0.6 0.86
52 51 0.24 0.65
76 92 0.98 0.6
96 78 0.74 0.5
45 58 0.46 0.68
44 93 0.77 0.84
93 24 0.66 0.9
98 66 0.08 0.85
59 58 0.15 0.8
69 53 0.37 0.69
49 35 0.59 0.87
58 73 0.84 0.81
77 83 0.93 0.92
4 67 0.92 0.36
92 2 0.45 0.34
12 65 0.71 0.67
15 35 0.02 0.86
25 45 0.42 0.51
45 18 0.36 0.59
57 19 0.5 0.83
31 70 0.89 0.51
39 19 0.87 0.84
64 39 0.03 0.93
19 73 0.16 0.65
9 49 0.49 0
69 51 0.2 0.58
98 35 0.88 0.95
6 66 0.4 0.00999999
35 17 0.08 0.97
93 13 0.71 0.97
60 31 0.69 0.77
47 92 0.16 0.96
46 84 0.16 0.7
4 7 0.77 0.5
16 52 0.35 0.91
16 9 0.16 0.44
34 30 0.6 0.55
70 97 0.93 0.72
81 74 0.28 0.73
57 80 0.57 0.65
5 24 0.73 0.47
34 1 0.32 0.03
85 99 0.78 0.51
55 60 0.43 0.94
43 71 0.68 0.83
3 63 0.83 0.3
34 0 0.18 0.49
64 4 0.37 0
10 21 0.74 0.57
87 69 0.73 0.64
71 38 0.17 0.83
60 46 0.54 0.71
30 78 0.34 0.9
51 23 0.57 0.94
75 69 0.53 0.74
48 84 0.34 0.89
97 87 0.38 0.68
88 63 0.7 0.91
85 96 0.63 0.94
54 13 0.74 0.6
68 46 0.11 0.64
71 37 0.71 0.85
36 42 0.06 0.73
18 20 0 0.65
51 6 0.49 0.04
56 51 0.06 0.6
16 0 0.98 0.24
61 16 0.77 0.89
44 38 0.39 0.5
9 13 0.77 0.45
62 45 0 0.74
76 28 0.54 0.5
95 59 0.62 0.83
72 81 0.79 0.93
95 76 0.11 0.65
97 99 0.14 0.77
58 52 0.77 0.71
16 76 0.42 0.81
8 35 0.91 0.15
89 76 0.69 0.87
33 20 0.13 0.8
78 21 0.08 0.95
34 15 0.85 0.66
43 50 0.11 0.86
86 51 0.04 1
25 64 0.88 0.53
74 5 0.82 0.17
78 76 0.16 0.53
82 39 0.97 0.71
44 16 0.99 0.95
58 73 0.01 0.76
2 9 0.58 0.15
49 27 0.05 0.92
74 34 0.29 0.82
73 77 0.25 0.6
1 92 0.67 0.00999999
37 22 0.86 0.91
2 64 0.54 0.42
98 74 0.36 1
11 65 0.73 0.85
14 40 0.13 0.83
58 91 0.85 0.68
92 73 0.2 0.58
5 72 0.16 0.13
66 15 0.14 0.98
78 11 0.61 0.95
34 6 0.56 0.45
96 52 0.29 0.53
58 82 0.49 0.57
1 53 0.97 0.21
35 79 0.13 0.84
66 9 0.87 0.49
90 56 0.95 0.56
94 83 0.31 0.54
22 21 0.76 1
19 59 0.86 0.99
4 45 0.84 0.4
88 90 0.33 0.98
15 85 0.86 0.9
89 13 0.68 0.54
68 23 0.54 0.86
66 26 0.33 0.54
67 39 0.54 0.81
96 87 0.09 0.62
52 18 0.35 0.58
66 20 0.31 0.72
55 74 0.21 0.56
9 77 0.65 0.31
8 19 0.57 0.16
4 63 0.6 0.23
80 81 0.46 0.83
42 18 0.1 0.52
46 23 0.56 0.79
43 77 0.43 0.97
91 97 0.98 0.93
18 78 0.08 0.97
59 15 0.01 0.5
82 69 0.76 0.7
53 93 0.64 0.8
65 86 0.37 0.7
47 49 0.58 0.99
55 76 0.43 0.76
4 40 0.95 0.13
41 70 0.51 0.83
52 85 0.46 0.92
31 70 0.27 0.78
55 28 0.41 0.76
1 5 0.83 0.08
86 49 0.91 0.99
35 81 0.78 0.6
53 82 0.71 0.58
93 27 0.07 0.9
59 64 0.4 0.91
16 37 0.13 0.55
69 67 0.17 0.76
82 41 0.93 0.72
43 41 0.03 0.67
74 8 0.62 0.15
6 39 0 0.24
54 72 0.71 0.98
0 52 0.81 0.39
92 58 0.08 0.76
51 24 0.92 0.92
69 72 0.07 0.9
79 11 0.4 0.68
93 85 0.35 0.73
79 59 0.83 0.67
65 8 0.47 0.00999999
40 85 0.99 0.7
11 5 0.08 0.3
74 45 0.85 0.88
14 28 0.57 0.74
93 9 0.77 0.45
75 24 0.09 0.55
33 54 0.29 0.85
25 21 0.26 0.87
86 95 0.43 0.88
85 62 0.92 0.74
53 76 0.34 0.84
67 20 0.66 0.85
69 17 0.09 0.96
96 53 0.49 0.53
71 68 0.9 0.62
34 82 0.98 0.83
91 83 0.28 0.64
23 65 0.82 0.81
48 95 0.99 0.5
6 72 0.68 0.31
64 86 0.08 0.97
28 80 0.16 0.97
10 46 0.6 0.61
48 39 0.45 0.58
54 11 0.85 0.78
60 66 0.4 0.65
32 45 0.11 0.91
2 28 0.72 0.07
81 91 0.96 0.79
72 97 0.16 0.58
76 30 0.71 0.99
20 60 0.96 1
15 44 0.9 0.61
61 30 0.98 0.82
52 34 0.27 0.84
56 12 0.52 0.62
36 18 0.36 0.77
55 80 0.92 0.53
75 29 0.25 0.68
65 61 0.74 0.58
98 42 0.01 0.75
17 39 0.53 0.53
4 37 0.04 0.35
63 32 0.52 0.51
58 74 0.58 0.53
66 50 0 0.85
59 16 0.37 0.68
24 74 0.57 0.79
68 70 0.35 0.6
48 58 0.21 0.93
61 96 0.49 0.97
79 8 1 0.49
13 39 0.56 0.75
23 81 0.23 0.76
54 65 0.49 0.78
36 43 0.95 0.97
68 18 1 0.86
70 0 0.96 0.05
73 14 0.57 0.71
88 80 0.21 0.6
24 89 0.38 0.91
40 27 0.56 0.89
2 82 0.69 0.23
65 32 0.61 0.62
54 48 0.94 0.5
60 59 0.85 0.88
38 32 0.31 0.85
3 1 0.83 0.33
12 64 0.64 0.97
57 22 0.76 0.52
87 69 0.21 0.78
71 54 0.55 0.94
59 83 0.64 0.81
21 49 0.09 0.76
60 84 0.05 0.61
67 73 0.61 0.81
55 8 0.1 0
40 56 0.6 0.65
3 32 0.22 0.32
43 67 0.35 0.77
94 14 0.03 0.57
21 28 0.28 0.75
26 75 0.64 0.81
12 49 0.48 0.59
32 25 0.31 0.82
55 27 0.8 0.87
28 70 0.21 0.66
64 48 0.38 0.85
83 31 0.99 0.64
84 6 0.15 0.05
32 73 0.37 1
71 94 0.75 0.64
75 24 0.12 0.55
94 53 0.09 0.97
45 86 0.74 0.95
10 22 0.6 0.88
26 21 0.83 0.68
3 74 0.98 0.2
54 10 0.02 0.55
67 58 0.69 0.57
25 39 0.78 0.85
75 1 0.45 0.15
19 14 0.82 0.55
90 63 0.91 0.66
36 72 0.9 0.83
62 40 0.43 0.75
9 55 0.87 0.12
56 75 0.42 0.71
97 7 0.51 0.4
80 83 0.68 0.79
25 53 0.38 0.51
3 93 0.07 0.02
72 3 0.94 0.08
35 91 0.89 0.87
64 38 0.95 0.67
51 23 0.34 0.72
55 1 0.63 0.46
84 99 0.14 0.65
83 99 0.26 0.68
9 19 0.38 0.28
67 68 0.56 0.68
0 33 0.27 0.49
27 25 0.45 0.92
63 0 0.81 0.00999999
76 51 0.78 0.52
28 93 0.46 0.93
26 84 0.36 0.67
69 92 0.12 0.97
36 51 0.42 0.66
88 21 0.33 0.7
19 10 0.94 0.88
60 49 0.16 0.58
11 95 0.51 0.67
39 61 0.97 1
60 4 0.45 0.16
66 86 0.86 0.73
71 98 0.67 0.87
32 91 0.97 0.62
39 23 0.45 0.62
79 34 0.72 0.67
56 96 0.55 0.51
81 47 0.21 0.85
43 19 0.81 0.85
80 16 0.35 0.64
72 62 0.35 0.93
54 60 0.86 0.89
95 59 0.93 1
42 63 0.62 0.86
88 53 0.26 0.94
74 43 0.79 0.7
7 26 0.17 0.00999999
19 18 0.57 0.79
92 55 0.43 0.73
9 30 0.28 0.24
12 9 0.33 0.39
76 28 0.16 0.68
62 96 0.64 0.85
3 25 0.78 0.12
63 47 0.06 0.6
52 76 0.69 0.89
54 25 0.91 0.99
42 50 0.77 0.67
89 35 0.57 0.98
94 37 0.88 0.58
6 24 0.26 0.25
11 17 0.71 0.9
31 43 0.76 0.77
78 54 0.58 0.86
63 85 0.68 0.7
63 84 0.08 0.97
2 60 0.88 0.00999999
78 14 0.54 0.93
1 61 0.37 0.37
38 60 0.92 0.95
79 39 0.14 0.86
22 0 0.26 0.5
33 77 0.58 0.88
7 17 0.6 0.1
7 8 0.65 0.41
31 71 0.58 0.95
39 90 0.93 0.69
40 61 0.25 0.79
21 75 0.9 0.69
78 1 0.48 0.13
47 3 0.71 0.41
7 58 0.61 0.05
67 59 0.43 0.89
76 10 0.65 0.76
14 15 0.69 0.5
31 97 0.2 0.95
15 17 0.48 0.57
1 9 0.52 0.27
69 58 0.01 0.57
72 39 0.96 0.7
93 19 0.59 0.78
85 17 0.45 0.8
46 33 0.42 0.91
51 61 0.65 0.55
71 54 0.25 0.71
63 77 0.42 0.84
53 74 0.12 0.97
34 86 0.62 0.86
6 86 0.42 0.1
47 27 0.98 0.61
27 32 0.58 0.72
70 40 0.77 0.94
47 53 0.2 0.62
41 28 0.55 0.5
5 22 0.24 0.15
7 26 0.53 0.03
58 28 0.9 0.55
60 25 0.12 0.98
45 0 0.41 0.39
38 73 0.11 0.65
26 48 0.44 0.68
96 11 0.34 0.68
99 76 0.58 0.62
81 9 0.97 0.36
2 13 0.41 0.05
41 88 0.27 0.68
24 61 0.63 1
57 15 0.71 0.78
91 45 0.24 0.67
66 27 0 0.55
38 78 0.47 0.55
34 33 0.01 0.6
88 17 0.08 0.68
27 6 0.6 0.04
85 11 0.79 0.77
42 79 0.38 0.65
28 17 0.98 0.5
13 61 0.69 0.53
94 9 0.98 0.04
53 87 0.8 0.81
65 79 0.59 0.73
28 59 0.66 0.87
14 13 0.44 0.55
25 29 0.31 0.88
84 76 0.32 0.96
71 88 0.44 0.82
3 84 0.71 0.1
46 79 0.68 0.56
82 48 0.89 0.68
78 17 0.44 0.71
97 68 0.27 0.57
86 13 0.72 0.54
43 37 0.96 0.96
34 99 0.69 0.61
33 57 0.57 0.79
33 69 0.62 0.97
53 40 0.5 0.79
56 94 0.35 0.92
52 16 0.68 0.7
53 71 0.63 0.51
49 50 0.68 0.56
69 73 0.77 0.85
20 82 0.9 0.77
86 68 0.7 0.89
60 7 0.52 0.18
90 68 0.09 0.55
97 61 0.2 0.94
6 90 0.98 0.09
50 69 0.45 0.71
31 43 0.8 0.76
28 52 0.85 0.53
57 45 0.16 0.95
77 36 0.32 0.58
23 93 0.35 0.97
46 82 0.96 0.66
5 15 0.5 0.16
90 51 0.93 0.97
54 29 0.97 0.56
57 63 0.6 0.9
14 53 0.92 0.77
86 21 0.84 0.66
85 17 0.11 0.76
49 93 0.75 0.64
94 74 0.41 0.69
14 56 0.45 0.53
25 3 0.23 0.49
39 47 0.04 0.82
9 30 0.36 0
62 24 0.58 0.67
15 6 0.88 0.03
53 76 0.52 0.77
97 19 0.86 0.87
64 15 0.26 0.76
40 88 0.94 0.5
3 4 0.64 0.13
74 68 0.37 0.76
81 74 0.92 0.52
5 43 0.94 0.35
70 52 0.36 0.82
54 50 0.76 0.5
13 94 0.57 0.85
51 30 0.88 0.61
11 5 0.53 0.07
26 49 0.06 0.73
83 75 0.05 0.74
63 67 0.06 0.75
12 9 0.38 0.21
58 90 0.54 0.5
38 27 0.01 0.67
54 95 0.23 0.83
92 27 0.59 0.73
59 3 0.46 0.3
76 63 0.62 0.76
77 3 0.25 0.19
91 74 0.07 0.74
79 49 0.98 0.8
77 23 0.37 0.95
97 32 0.53 0.64
39 78 0.12 0.59
90 16 0.65 0.64
32 45 0.25 0.61
52 95 0.56 0.62
15 77 0.37 0.58
70 53 0.18 0.79
4 90 0.13 0.21
77 81 0.2 0.83
78 74 0.82 0.79
80 26 0.36 0.94
23 35 0.16 1
6 75 0.38 0.32
60 48 0.93 0.54
4 51 0.66 0.34
21 40 0.92 0.96
36 29 0.05 0.67
67 99 0.28 0.81
72 57 0.84 0.61
85 43 0.38 0.72
44 90 0.93 0.53
34 24 0.51 0.58
32 78 0.93 0.86
98 88 0.49 0.58
35 58 0.82 0.94
97 72 0.92 0.54
61 55 0.79 0.6
22 5 0.12 0.33
81 76 0.02 0.65
77 69 0.61 0.97
24 56 0.38 0.68
20 71 0.27 0.62
94 70 0.61 0.72
51 80 0.43 0.98
18 1 0.59 0.18
23 20 0.84 0.87
5 27 0.24 0.06
15 80 0.9 0.78
27 10 0.71 0.84
58 49 0.16 0.74
90 75 0.45 0.81
62 43 0.93 0.68
96 54 0.48 0.86
Daniele_97
Junior Member
Junior Member
 
Messaggio: 32 di 102
Iscritto il: 10/12/2016, 19:38

Re: [C++] Programma C++ con classi non funziona bene.

Messaggioda Daniele_97 » 21/01/2019, 00:59

Nel caso con #define Nut 1000 contiene questi numeri
680 62 0.7 0.13
185 179 0.47 0.69
908 397 0.83 0.89
641 681 0.56 0.88
789 970 0.83 0.87
154 726 0.63 0.61
601 377 0.24 0.86
325 650 0.14 0.9
970 45 0.46 0.47
622 361 0.64 0.6
719 363 0.25 0.79
781 138 0.65 0.65
281 828 0.95 0.9
453 673 0.25 0.9
670 911 0.72 0.87
888 830 0.63 0.94
625 781 0.54 0.85
841 875 0.77 0.52
304 971 0.11 0.84
449 274 0.98 0.67
85 459 0.74 0.15
563 429 0.69 0.65
686 59 0.83 0.23
815 740 0.52 0.9
622 460 0.01 0.95
611 322 0.87 0.75
276 498 0.33 0.94
321 392 0.03 0.75
741 978 0.47 0.71
66 618 0.12 0.5
253 187 0.65 0.76
718 127 0.72 0.55
492 872 0.85 0.97
520 566 0.14 0.98
88 265 0.99 0.5
648 416 0.72 0.82
844 89 0.99 0.15
489 81 0.71 0.36
140 742 0.21 0.5
627 403 0.7 0.89
195 588 0.99 0.54
458 331 0.1 0.52
430 634 0.25 0.97
917 2 0.2 0.28
79 315 0.18 0.25
664 301 0.49 0.72
354 223 0.75 0.85
467 293 0.06 0.56
179 759 0.79 0.82
41 120 0.3 0.06
238 685 0.18 0.8
162 551 0.09 0.51
509 658 0.21 0.71
161 230 0.18 0.83
206 885 0.63 0.79
534 335 0.31 0.52
195 483 0.24 0.62
253 407 0.85 0.9
968 545 0.2 0.5
709 663 0.99 0.76
648 308 0.6 0.99
146 860 1 0.57
224 802 0.44 0.54
956 263 0.71 0.83
514 438 0.27 0.78
446 398 0.7 0.97
220 0 0.77 0.32
24 977 0.3 0.35
455 506 0.78 0.79
853 918 0.82 0.7
152 164 0.27 0.64
229 86 0.72 0.16
554 497 0.84 0.65
268 806 0.25 0.6
882 952 0.59 0.74
866 871 0.79 0.95
106 916 0.97 0.85
345 334 0.68 0.6
951 820 0.11 0.83
682 780 0.77 0.62
18 348 0.55 0.42
200 615 0.6 0.88
986 890 0.82 0.54
594 687 0.3 0.79
529 785 0.88 0.9
822 306 0.87 0.54
27 202 0.2 0.39
705 825 0.57 0.66
754 30 0.09 0.43
88 472 0.55 0.49
85 189 0 0.26
170 42 0.28 0.2
796 483 0.59 0.94
243 307 0.56 0.94
5 630 0.37 0.23
523 436 0.87 0.61
594 241 0.06 0.55
77 603 0.47 0.16
873 347 0.04 0.6
849 752 0.85 0.61
499 496 0.53 0.68
706 9 0.78 0.31
493 7 0.7 0.33
729 102 0.05 0.71
354 795 0.26 0.6
448 430 0.89 0.86
567 210 0.74 0.92
23 673 0.74 0.2
142 433 0.6 0.92
138 819 0.67 0.59
12 894 0.74 0.16
745 743 0.85 0.83
763 325 0.46 0.7
775 114 0 0.65
64 284 0.39 0.27
612 860 0.92 0.7
981 22 0.07 0.14
299 187 0.38 0.58
832 435 0.83 0.58
525 87 0.38 0.19
835 887 1 0.73
236 319 0.63 1
474 887 0.53 0.59
208 410 0.82 0.61
952 111 0.44 0.89
13 759 0.48 0.03
675 662 0.81 0.62
691 830 0.5 0.93
195 120 0.77 0.86
837 980 0.68 1
127 996 0.59 0.56
395 387 0.25 0.73
208 899 0.38 0.66
472 920 0.26 0.82
243 727 0.86 0.77
165 868 0.3 0.55
523 554 0.4 0.73
188 467 0.81 0.66
565 170 0.06 0.96
893 55 0.49 0.38
883 708 0.23 0.77
933 94 0.57 0.08
386 902 0.53 0.59
162 136 0.78 0.7
412 67 0.2 0.26
192 186 0.19 0.64
782 627 0.7 0.84
255 254 0.39 0.77
563 744 0.37 0.76
18 905 0.67 0.41
239 274 0.29 0.66
801 75 0.76 0.41
900 892 0.82 0.62
888 746 0.77 0.72
985 397 0.1 0.79
95 488 0.73 0.00999999
278 800 0.85 0.67
880 480 0.99 0.83
850 892 0.08 0.82
500 325 0.77 0.55
549 685 0.08 0.76
614 563 0.01 0.81
598 937 0.88 0.92
166 300 0.08 0.5
46 324 0.9 0.44
40 684 0.07 0.13
250 84 0.52 0.16
274 798 0.77 0.7
61 150 0.36 0.39
841 485 0.11 0.67
493 287 0.91 0.8
517 971 0.96 0.94
561 347 0.98 0.76
152 654 0.75 0.72
921 834 0.84 0.53
739 373 0.44 0.51
894 414 0.2 0.85
569 863 0.4 0.76
757 607 0.06 0.54
258 749 0.3 0.76
505 791 0.32 0.84
98 492 0.27 0.02
558 246 0.05 0.55
39 436 0.72 0.19
951 422 0.38 0.7
166 555 0.78 0.61
464 944 0.09 0.78
639 154 0.36 0.6
773 158 0.37 0.88
964 270 0.77 0.65
841 543 0.54 0.83
222 873 0.56 0.5
352 542 0.01 0.87
64 151 0.27 0.31
598 163 0.11 0.86
970 674 0.81 0.97
709 377 0.21 0.71
832 102 0.88 0.87
362 534 0.6 0.73
632 309 0.04 0.68
664 190 0.86 0.57
832 748 0.19 0.53
661 553 0.04 0.66
165 68 0.7 0.24
872 960 0.85 0.96
149 66 0.31 0.4
697 683 0 0.64
982 336 0.41 0.8
673 974 0.74 0.8
564 178 0.87 0.89
70 751 0.41 0.42
431 297 0.56 0.69
272 2 0.2 0.2
730 979 0.57 0.87
407 806 0.34 0.71
510 585 0.72 0.67
914 318 0.12 0.52
725 8 0.31 0.05
225 984 0.39 0.5
344 593 0.16 0.99
900 793 0.14 0.83
689 929 0.17 0.58
498 839 0.54 0.58
129 890 0.33 0.8
67 533 0.25 0.25
843 544 0.11 0.78
742 899 0.23 0.85
80 924 0.88 0.11
196 667 0.31 0.69
969 204 0.36 0.7
659 69 0 0.41
744 817 0.03 0.76
797 284 0.3 0.97
815 592 0.14 0.65
918 191 0.96 0.75
878 762 0.19 0.83
49 385 0.96 0.06
882 364 0.06 0.75
563 674 0.95 0.86
929 743 0.16 0.8
750 355 0.79 0.94
599 697 0.84 0.66
799 749 0.52 0.64
44 778 0.17 0.15
329 523 0.44 0.69
804 704 0.65 0.68
864 180 0.06 0.85
22 708 0.65 0.22
23 186 0.73 0.31
221 907 0.63 0.94
115 277 0.36 0.95
250 454 0.28 0.9
357 545 0.16 0.61
943 258 0.33 0.53
900 4 0.41 0.05
493 24 0.1 0.2
160 265 0.36 0.73
608 6 0.36 0.22
344 599 0.57 0.85
766 700 0.76 0.78
437 802 0.46 0.58
875 792 0.89 0.76
989 913 0.96 0.93
648 506 0.3 0.96
922 271 0.4 0.86
447 513 0.77 0.9
112 195 0.42 0.52
161 469 0.31 0.95
786 0 0.45 0.3
472 347 0.68 0.69
365 29 0.44 0.4
854 476 0.57 0.8
51 933 0.06 0.4
796 685 0.97 1
794 360 0.3 0.69
371 144 0.59 0.74
138 425 0.73 0.64
207 930 0.32 0.79
779 358 0.58 0.92
310 684 0.08 0.63
740 635 0.21 0.77
78 50 0.95 0.15
749 48 0.77 0.3
628 687 0.48 0.61
375 790 0.12 0.56
150 287 0.02 0.88
662 797 0.08 0.71
354 459 0.33 1
862 881 0.91 0.66
245 104 0.11 0.91
251 793 0.02 0.56
69 952 0.01 0.08
663 391 0.66 0.99
438 664 0.56 0.7
432 290 0.35 0.73
849 793 0.75 0.79
272 759 0.29 0.84
617 79 0.3 0.43
555 788 0.79 0.95
820 373 0.66 0.64
316 643 0.44 0.6
576 814 0.96 0.6
416 741 0.84 0.71
27 717 0.23 0.18
577 781 0.56 0.63
346 479 0.5 0.51
901 40 0.1 0.44
683 812 0.85 0.89
397 84 0.05 0.38
362 457 0.83 0.59
230 334 0.78 0.88
184 233 0.94 0.51
763 506 0.83 0.85
416 7 0.51 0.09
441 751 0.53 0.52
520 173 0.91 0.65
417 368 0.15 0.5
198 817 0.95 0.52
866 676 0.32 0.99
984 611 0.03 0.94
869 687 0.01 0.61
411 640 0.16 0.74
311 167 0.84 0.95
725 330 0.99 0.83
338 272 0.04 0.96
83 854 0.17 0.34
836 960 0.12 0.77
155 324 0.4 0.78
311 124 0.96 0.99
979 90 0.86 0.14
631 425 0.4 0.71
129 121 0.67 0.92
103 924 0.95 0.96
848 31 0.57 0.39
332 267 0.04 0.5
490 116 0.6 0.63
257 273 0.39 0.84
368 573 0.24 0.63
201 549 0.72 0.57
787 428 0.83 0.81
104 339 0.7 0.99
391 317 0.85 0.99
299 562 0.89 0.68
915 234 0.21 0.68
91 941 0 0.23
658 273 0.57 0.92
37 147 0.44 0.44
429 865 0.45 0.53
949 887 0.25 0.78
975 880 0.31 0.6
591 864 0.05 0.59
423 128 0.1 0.55
645 58 0.25 0.41
762 877 0.2 0.86
372 483 0.47 0.7
310 481 0.69 0.51
694 822 0.16 0.58
696 160 0.86 0.52
281 380 0.48 0.77
71 284 0.7 0.3
967 438 0.09 0.88
190 578 0.8 0.67
652 636 0.61 0.52
590 899 0.25 0.78
611 217 0.2 0.92
946 333 0.76 0.68
194 133 0.86 0.73
513 623 0.55 1
321 250 0.27 0.56
288 536 0.87 0.72
775 343 0.6 0.57
421 177 0.11 0.77
956 568 0.65 0.53
485 310 0.6 0.87
832 36 0.39 0.04
775 873 0.94 0.67
419 246 0 0.85
694 415 0.78 0.76
619 460 0.96 0.9
627 409 0.13 0.52
666 723 0.11 0.71
673 276 0.82 0.52
917 121 0.04 0.76
175 962 0.12 0.6
421 601 0.32 0.9
954 383 0.02 0.91
746 195 0.26 0.8
328 356 0.71 0.76
659 113 0.15 0.97
166 615 0.97 0.71
615 772 0.46 0.67
867 321 0.67 0.56
8 845 0.28 0.4
906 575 0.23 0.67
466 108 0.32 0.86
244 122 0.98 0.78
536 596 0.23 0.84
756 215 0.19 0.89
848 28 0.6 0.37
370 888 0.69 0.68
234 320 0.19 0.89
224 400 0.04 0.7
237 414 0.98 0.63
392 475 0.02 0.8
418 610 0.03 0.62
764 236 0.33 0.88
679 979 0.62 0.92
35 565 1 0.27
445 563 0.83 0.68
947 235 0.96 0.77
802 682 0.31 0.72
922 222 0.41 0.91
799 948 0.3 0.63
412 805 0.81 0.67
459 903 0.22 0.66
280 761 0.99 0.88
663 694 0.77 0.64
643 189 0.86 0.53
49 296 0.45 0.06
819 373 0.38 0.57
465 290 0.14 0.66
685 20 0.17 0.09
686 897 0.72 0.69
352 388 0.21 0.9
362 417 0.63 1
784 649 0.97 0.79
153 600 0.32 0.65
364 206 0.31 0.65
879 203 0.58 0.53
704 15 0.24 0.39
375 944 0.76 0.6
99 325 0.89 0.03
228 859 0.27 0.65
370 966 0.59 0.95
668 754 0.76 0.72
971 738 0.73 0.9
952 73 0.41 0.33
651 895 0.29 0.93
686 382 0.8 0.51
737 726 0.41 0.65
167 733 0.03 0.58
537 995 0.19 0.84
897 502 0.97 0.73
586 721 0.74 0.93
814 938 0.95 0.88
848 500 0.41 0.94
299 202 0.36 0.52
10 941 0.72 0.12
66 639 0.16 0.25
717 97 0.83 0.38
128 779 0.06 0.83
287 178 0.27 0.98
344 191 0.27 0.51
605 173 0.72 0.83
574 211 0.72 0.78
30 131 0.9 0.03
493 529 0.72 0.88
710 64 0.23 0.41
561 338 0.52 0.89
988 567 0.13 0.7
566 112 0.96 0.6
908 996 0.45 0.84
855 106 0.55 0.65
974 120 0.75 0.88
232 707 0.66 0.93
612 32 0.72 0.37
381 51 0.29 0.02
664 382 0.54 0.61
24 796 0.93 0.00999999
804 551 0.13 0.63
167 471 0.98 0.53
152 771 0.19 0.68
283 133 0.89 0.9
888 33 0.87 0.1
754 446 0.15 0.91
123 856 0.13 0.62
174 533 0.04 0.78
637 391 0.85 0.73
516 241 0.93 0.56
405 686 0.76 0.88
862 350 0.64 0.79
832 138 0.73 0.84
529 866 0.31 0.67
541 189 0.28 0.5
992 425 0.52 0.86
119 340 0.26 0.8
127 938 0.83 0.65
174 967 0.62 0.53
633 23 0.66 0.33
341 388 0.7 0.67
771 545 0.26 1
390 621 0.03 0.93
598 929 0.91 0.86
562 957 0.18 0.63
137 504 0.89 0.72
265 919 0.59 0.66
244 472 0.9 0.8
840 631 0.11 0.84
758 833 0.5 0.52
278 823 0.03 0.95
96 925 0.7 0.34
342 4 0.23 0.41
736 236 0.35 0.68
552 118 0.25 0.61
255 833 0.81 0.97
655 843 0.09 0.72
988 971 0.33 0.95
341 508 0.05 0.75
342 109 0.86 0.67
435 47 0.94 0.18
958 246 0.15 0.71
969 644 0.57 0.89
515 130 0.32 0.58
412 112 0.79 0.81
635 15 0.56 0.18
83 589 1 0.35
873 832 0.02 0.78
113 855 0.06 0.66
657 838 0.82 0.76
822 312 0.85 0.63
246 274 0.02 0.7
334 421 0.62 0.99
397 444 0.33 0.69
608 783 0.48 0.59
903 32 0.01 0.15
552 700 0.11 0.66
835 131 0.11 0.51
14 140 0.55 0.4
961 994 0.13 0.61
477 796 0.01 0.78
112 556 0.58 0.91
316 477 0.69 0.67
402 531 0.29 0.96
456 822 0.13 0.89
706 135 0.28 0.67
208 950 0.6 0.95
317 210 0.51 0.85
728 763 0.66 0.58
142 301 0.29 0.79
743 94 0.96 0.09
552 506 0.82 0.88
130 268 0.77 0.95
472 208 0.94 0.69
510 999 0.17 0.7
720 122 0.21 0.73
577 51 0.26 0.18
758 984 0.27 0.56
954 561 0.3 0.7
451 21 0.48 0.09
244 983 0.92 0.55
780 367 0.6 0.55
15 582 0.14 0.48
796 122 0.96 0.56
575 659 0.22 1
752 29 0.64 0.44
147 471 0.34 0.74
713 259 0.96 0.8
767 256 0.48 0.82
494 444 0.58 0.73
723 965 0.98 0.97
848 418 0.93 0.93
642 93 0.66 0.32
292 212 0.01 0.9
820 528 0.38 0.81
636 222 0.83 0.95
268 36 0.65 0.22
694 158 0.69 0.96
930 914 0.69 0.97
395 105 0.11 0.9
762 55 0.25 0.08
834 196 0.39 0.67
603 564 0.29 0.66
731 100 0.18 0.74
146 550 0.16 0.91
140 119 0.64 0.97
532 167 0.02 0.82
711 168 0.57 0.55
751 522 0.25 0.6
514 999 0.66 0.77
658 219 0.67 0.68
958 134 0.9 0.9
400 293 0.49 0.87
344 517 0.52 0.76
257 962 0.98 0.73
979 175 0.56 1
257 206 0.75 0.58
684 523 0.52 0.68
280 636 0.22 0.62
260 220 0.75 0.9
864 424 0.52 0.75
498 433 0.63 0.59
434 811 0.87 0.52
367 814 0.39 0.84
529 555 0.28 0.85
144 257 0.59 0.94
828 624 0.7 0.88
31 373 0.89 0.29
433 680 0.56 0.55
778 299 0.46 1
453 428 0.54 0.67
491 892 0.62 0.93
413 521 0.09 0.87
910 345 0.52 0.53
728 567 0.65 0.98
110 963 0.96 0.84
371 997 0.91 0.71
809 435 0.15 0.72
75 796 0.14 0.24
951 875 0.83 0.63
822 791 0.68 0.72
983 282 0.65 0.76
3 49 0.66 0.34
89 476 0.38 0.49
5 279 0.45 0.5
661 512 0.35 0.81
589 866 0.24 0.77
795 273 0.41 0.84
733 558 0.43 0.65
41 149 0.34 0.35
813 390 1 0.75
241 521 0.06 0.76
265 6 0.91 0.35
159 323 0.61 0.55
185 95 0.26 0.05
751 791 0.11 0.67
24 214 0.56 0.48
981 451 0.21 0.99
78 950 0.08 0.36
284 826 0.15 0.83
374 553 0.99 0.79
40 12 0.83 0.24
585 443 0.61 0.86
67 181 0.72 0.48
337 959 1 0.56
684 274 0.48 0.84
854 520 0.92 0.81
923 471 0.83 1
228 106 0.56 0.77
790 147 0.72 0.93
643 838 0.99 0.55
904 850 0.25 0.81
446 425 0.1 0.67
476 59 0.58 0.24
261 165 0.17 0.71
78 191 0.07 0.21
948 47 0.18 0.11
347 576 0.59 0.68
281 711 0.95 0.66
172 560 0.65 0.92
193 515 0.95 0.85
135 669 0.88 0.78
251 685 0.7 0.92
118 772 0.93 0.74
92 32 0.44 0
326 339 0.43 0.82
482 231 0.6 0.81
696 957 0.77 0.51
17 639 0.3 0.02
420 18 0.23 0.00999999
145 152 0.01 0.62
857 188 0.06 0.64
749 687 0.73 0.55
94 59 0.7 0.41
597 839 0.35 0.52
821 42 0.98 0.29
422 403 0.07 0.59
771 672 0.16 0.78
557 837 0.55 0.68
865 232 0.8 0.55
839 675 0.47 0.7
469 481 0.79 0.8
44 173 0.44 0.03
34 935 0.26 0.09
279 456 0.32 0.6
379 88 0.35 0.17
704 750 0.23 0.82
620 352 0.1 0.53
651 91 0.22 0.32
714 469 0.44 0.82
606 145 0.55 0.93
342 108 0.82 0.56
526 645 0.09 0.81
350 538 0.6 0.78
635 937 0.33 0.62
356 579 0 0.9
767 536 0.8 0.88
77 239 0.31 0.41
363 637 0.35 0.56
435 688 0.94 0.95
930 92 0.73 0.37
539 182 0.44 0.71
532 415 0.94 0.85
984 67 0.87 0.48
677 650 0.47 0.75
254 663 0.43 0.7
763 799 0.21 0.7
216 620 0.96 0.52
91 651 0.68 0.16
250 299 0.37 0.58
573 936 0.13 0.87
399 854 1 0.59
859 505 0.33 0.93
389 428 0.16 0.78
550 752 0.09 0.77
804 504 0.12 0.5
978 916 1 0.92
3 826 0.2 0.24
837 987 0.29 0.92
947 333 0.48 0.85
467 212 0.5 0.79
378 879 0.38 0.69
605 353 0.65 0.83
769 292 0.05 0.86
621 981 0.99 0.93
998 980 0.86 0.87
235 562 0.81 0.65
419 784 0.89 0.84
948 85 0.21 0.1
29 480 0.73 0.42
870 727 0.53 0.59
662 56 0.61 0.3
885 142 0.96 0.57
187 167 0.16 0.8
745 155 0.29 0.58
359 302 0.58 0.92
581 474 1 0.77
366 279 0.35 0.57
354 741 0.8 0.65
483 988 0.35 0.59
234 505 0.94 0.95
971 379 0.56 0.95
942 999 1 0.62
991 177 0.55 0.95
480 164 0.37 0.56
934 212 0.75 0.83
433 457 0.4 0.97
680 399 0.4 0.95
197 372 0.51 0.75
196 498 0.6 0.96
234 526 0.82 0.53
755 743 0.31 0.8
356 979 0.56 0.91
419 334 0.19 0.75
548 749 0.55 0.9
917 954 0.94 0.64
900 785 0.99 0.61
927 986 0.87 0.74
93 975 0.12 0.23
539 993 0.11 0.87
521 710 0.93 0.57
494 55 0.02 0.24
505 687 0.58 0.67
610 437 0.03 0.92
73 822 0.79 0.5
445 964 0.89 0.72
359 556 0.69 0.59
215 39 0.89 0.28
351 191 0.99 0.76
280 901 0.38 0.99
642 80 0.99 0.41
320 288 0.15 0.8
506 995 0.06 0.55
12 136 0.96 0.18
704 675 0.28 0.72
872 577 0.02 0.69
54 148 0.82 0.22
415 57 0.31 0.16
197 7 0.82 0.35
125 995 0.09 0.56
825 90 0.39 0
38 94 0.31 0.48
632 549 0.24 0.95
276 190 0.3 0.74
438 654 0.76 0.81
917 522 0.21 0.69
708 518 0.85 0.9
18 701 0.57 0.00999999
20 394 0.2 0
218 550 0.1 0.87
711 594 0.76 0.73
412 584 0.4 0.85
144 213 0.17 0.94
321 418 0.99 0.79
542 163 0.98 0.8
976 439 0.23 0.61
381 162 0.46 0.79
159 799 0.83 0.7
877 498 0 0.91
17 581 0.35 0.07
410 833 0.12 0.87
842 287 0.31 0.64
435 231 0.23 0.97
957 593 0.07 0.99
795 923 0.31 0.8
455 795 0.92 0.93
131 149 0.32 0.68
737 126 0.55 0.66
5 793 0.36 0.3
682 954 0.22 0.98
418 514 0.8 0.93
603 363 0.9 0.92
518 637 0.02 0.56
145 608 0.71 0.77
71 474 0.16 0.34
206 515 0.45 0.99
370 807 0.22 0.91
720 435 0.37 1
125 540 0.44 0.59
0 909 0.1 0.28
102 840 1 0.72
717 127 0.35 0.69
130 602 0.71 0.57
271 395 0.73 0.58
471 625 0.63 0.84
356 98 0.52 0.43
787 573 0.15 0.76
990 671 0.32 0.98
699 731 0.21 0.59
179 663 0.9 0.93
805 933 0.26 0.53
227 72 0.97 0.42
878 736 0.76 1
366 127 0.47 0.5
236 380 0.56 0.87
860 512 0.1 1
293 320 0.49 0.6
915 114 0.9 0.97
726 835 0.13 0.78
820 968 0.25 0.69
757 363 0.79 0.73
814 129 0.94 0.73
832 698 0.37 0.72
577 649 0.94 0.87
700 45 0.07 0.07
829 494 0.69 0.8
823 948 0.47 0.96
545 324 0.46 0.87
574 700 0.75 0.84
676 834 0.44 0.59
72 767 0.9 0.49
863 650 0.65 0.95
336 387 0.93 0.94
273 708 0.52 0.93
623 879 0.45 0.55
810 36 0.81 0.43
159 745 0.09 0.92
680 16 0.41 0.36
514 867 0.72 0.57
117 971 0.42 0.58
681 561 0.72 0.8
815 12 0.01 0.12
718 741 0.91 0.75
543 119 0 0.59
946 164 0 0.51
466 411 0.21 0.53
319 174 0.99 0.87
723 419 0.94 0.89
352 985 0.69 0.59
703 782 0.7 0.64
299 150 0.74 0.53
816 175 0.7 0.86
662 659 0.35 0.52
659 573 0.69 0.64
479 439 0.41 0.74
513 924 0.21 0.98
491 113 0.2 0.94
937 746 0.03 0.77
928 154 0.19 0.59
221 226 0.31 0.73
171 902 0 0.99
865 405 0.77 0.71
51 616 0.11 0.33
535 300 0.65 0.73
843 371 0.35 0.8
966 287 0.39 0.78
460 377 0.42 0.71
262 113 0.62 0.69
97 607 0.68 0.43
141 698 0.57 0.54
225 159 0.99 0.76
54 948 0.11 0.22
753 685 0.79 0.79
916 606 0.38 0.98
351 642 0.41 0.81
195 796 0.02 0.53
736 149 0.1 0.58
456 901 0.02 0.67
723 29 0.83 0
780 156 0.13 0.77
163 952 0.73 0.92
437 559 0.65 0.91
121 743 0.59 0.71
956 891 0.01 0.75
680 479 0.14 0.96
64 742 0.81 0.35
631 921 0.07 0.52
642 563 0.43 0.84
547 107 0.8 0.79
319 354 0.21 0.63
426 278 0.77 0.59
466 829 0.14 0.64
817 214 0.79 0.76
135 141 0.26 0.55
639 733 0.56 0.84
16 467 0.94 0.09
280 288 0.95 0.68
876 319 0.88 0.96
451 512 0.65 0.8
323 468 0.87 0.73
707 10 0.75 0.45
820 369 0.35 0.93
962 167 0.53 0.83
31 210 0.95 0.11
801 901 0.51 0.73
99 901 0.48 0.28
746 516 0.22 0.5
649 478 0.02 0.81
671 258 0.87 0.85
950 284 0.1 0.63
720 896 0.25 0.77
493 329 0.83 0.96
848 787 0.83 0.97
427 669 0.11 0.99
464 564 0.14 0.83
938 188 0.77 0.95
163 856 0.99 0.94
111 396 0.79 0.72
96 560 0.69 0.17
660 176 0.13 0.53
292 362 0.39 0.53
54 543 0.9 0.4
53 198 0.66 0.26
744 742 0.65 0.94
936 898 0.79 0.55
566 802 0.26 0.81
572 303 0.8 0.53
770 991 0.93 0.56
69 474 0.95 0.00999999
851 563 0.76 0.67
330 931 0.03 0.83
225 475 0.69 0.6
879 753 0.98 0.94
563 486 0.08 0.74
763 541 0.83 0.81
513 365 0.63 0.74
715 242 0.7 0.75
674 657 0.53 0.53
941 547 0.92 0.85
367 773 0.69 0.52
406 525 0.95 0.7
30 319 0.81 0.38
349 657 0.14 0.71
328 547 0.58 0.78
830 524 0.67 0.88
291 337 0.99 0.82
600 262 0.42 0.66
761 674 0.52 0.78
303 590 0.09 0.85
647 991 0.39 0.57
610 4 0.27 0.18
31 601 0.46 0.12
614 142 0.34 0.81
990 770 0.11 0.89
618 868 0.32 0.53
751 571 0.84 0.96
185 756 0.23 0.75
6 76 0.57 0.47
891 742 0.73 0.78
493 247 0.32 0.52
99 961 0.59 0.38
739 477 0.51 0.87
906 820 0.14 0.59
432 976 0.5 0.66
499 870 0.03 0.94
451 807 0.12 0.93
134 695 0.88 0.71
964 789 0.72 0.68
918 277 0.59 0.76
490 562 0.57 0.64
442 384 0.4 0.6
46 288 0.16 0.25
63 749 0.02 0.46
542 464 0.05 0.6
116 495 0.52 0.83
979 419 0.51 0.58
765 193 0.5 0.56
108 553 0.49 0.61
801 22 0.88 0.49
584 725 0.53 0.83
220 481 0.73 0.85
983 750 0.42 0.64
213 205 0.28 0.58
986 448 0.41 0.73
169 247 0.91 0.51
975 793 0.07 0.69
391 934 0.34 0.75
486 925 0.82 0.53
682 586 0.36 0.76
535 723 0.08 0.95
866 698 0.38 0.84
Daniele_97
Junior Member
Junior Member
 
Messaggio: 33 di 102
Iscritto il: 10/12/2016, 19:38

Re: [C++] Programma C++ con classi non funziona bene.

Messaggioda Raptorista » 21/01/2019, 01:00

Ok, la prossima volta però usa pastebin per cose del genere: https://pastebin.com/
Un matematico ha scritto:... come mia nonna che vuole da anni il sistema per vincere al lotto e crede che io, in quanto matematico, sia fallito perché non glielo trovo


Immagine
Avatar utente
Raptorista
Moderatore
Moderatore
 
Messaggio: 5169 di 9616
Iscritto il: 28/09/2008, 19:58

Re: [C++] Programma C++ con classi non funziona bene.

Messaggioda Raptorista » 21/01/2019, 01:22

Il problema è che quando Nut vale 1000 il tuo programma esaurisce lo stack messo a disposizione dal sistema operativo e crasha. Ci sono diversi modi per raggirare il problema ma quello più corretto secondo me è di usare un vector fornito dalla libreria standard del C++ per la tua variabile V.
In pratica, questo si fa aggiungendo l'header
Codice:
#include<vector>

e rimpiazzando
Codice:
Utente V[Nut];

con
Codice:
vector<Utente> V(Nut);
Un matematico ha scritto:... come mia nonna che vuole da anni il sistema per vincere al lotto e crede che io, in quanto matematico, sia fallito perché non glielo trovo


Immagine
Avatar utente
Raptorista
Moderatore
Moderatore
 
Messaggio: 5170 di 9616
Iscritto il: 28/09/2008, 19:58

Prossimo

Torna a Informatica

Chi c’è in linea

Visitano il forum: Nessuno e 1 ospite