Fandom

Scratchpad

PLE:Unidad4Ejercicio05

215,972pages on
this wiki
Add New Page
Discuss this page0 Share

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

/*
Programa:         Unidad4Ejercicio05.cpp
Fecha:            24/11/2006
Descripción:      Programa quinielistico.

*/
#include <iostream>
#include <conio>
#include <stdlib>
#include <ctype>
using namespace std;

void main()
{
        int i, apuesta;
        char quiniela[15];

        for(i = 0; i < 15; i++)
        {
                apuesta = random(100);
                if(apuesta < 50)
                        quiniela[i] = '1';
                else if(apuesta < 80)
                        quiniela[i] = 'x';
                else
                        quiniela[i] = '2';
        }

        cout << "Resultados de la apuesta" << endl
        for(i = 0; i < 15; i++)
        {
                cout << "Apuesta " << i << " = " << quiniela[i];
        }

        cin.ignore();
        cin.get();
}

Also on Fandom

Random wikia