Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Test_1
- {
- class Program
- {
- static void Main(string[] args)
- {
- int mise, nbtirage =1, gain =0,gaininstant=0;
- Random alea = new Random();
- string saisie="";
- mise = 1;
- int n1 = 0;
- while (mise !=0)
- {
- Console.WriteLine("****************Mise numéro " + nbtirage + " ****************");
- Console.WriteLine("Saisir le montant de votre mise (0 pour arrêter)");
- saisie = Console.ReadLine();
- mise = Convert.ToInt32(saisie);
- n1 = alea.Next() % 10; ;
- Console.WriteLine("Tirage: "+n1);
- if (n1==7)
- {
- if(mise==0)
- {
- Console.WriteLine("Fin de partie !");
- }
- else
- {
- gaininstant = mise * 3;
- gain = gain + gaininstant;
- }
- }
- else
- {
- gain = gain - mise;
- }
- nbtirage++;
- }
- if (gain <= 0)
- {
- Console.WriteLine("Désolé !! Vous perdez " + -gain + " euros !!");
- }
- else
- {
- Console.WriteLine("Bravo !! Vous gagnez " + gain + " euros !!");
- }
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement