Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Standard view
Full view
of .
Save to My Library
Look up keyword
Like this
0 of .
Results for:
No results containing your search query
P. 1
ejercicios de c#

ejercicios de c#



|Views: 3,577 |Likes:
Published by mundo23

More info:

Published by: mundo23 on Aug 06, 2009
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as DOCX, PDF, TXT or read online from Scribd
See more
See less





PROGARAMA PARA DE SORTEOusing System;using System.Collections.Generic;using System.Text;namespace Exercici22_UD2{class Program{static void Main(string[] args){Random r = new Random();int num,cupo,r1,r2,r3,r4,n1,n2,n3,n4,a1,a2,a3,a4,c1,c2,c3,c4;cupo = r.Next(100000);Console.WriteLine("Que numero tenemos(5 digitos)");num =Convert.ToInt32(Console.ReadLine());Console.WriteLine("el numero premiadoes " + cupo);n1 = cupo / 10;r1 = cupo % 10;n2 = n1 / 10;r2 = n1 % 10;n3 = n2 / 10;r3 = n2 % 10;n4 = n2 / 10;r4 = n3 / 10;a1 = num / 10;c1 = num % 10;a2 = a1 / 10;c2 = a1 % 10;a3 = a2 / 10;c3 = a2 / 10;
a4 = a3 / 10;c4 = a3 % 10; if (num==cupo)Console.WriteLine("Coincidencia de los 5 digitos,has ganado 33.000 euros");else if (r1==c1 && r2==c2 && r3==c3&& r4==c4) Console.WriteLine("Coincidencia de los4 ultimos digitos, has ganado 150 euros");else if (r1==c1 && r2==c2 && r3==c3)Console.WriteLine("Coincidencia de los 3 ultimosdigitos, has guanyat 15 euros");else if (r1==c1 && r2==c2)Console.WriteLine("Coincidencia de los 2 ultimosdigitos, has ganado 5 euros");else if (r1==c1)Console.WriteLine("Coincidencia en el ultimodigito, has ganado 1,5 euros");else Console.WriteLine("Ningunacoincidencia, no has ganado nada");}}}
using System;using System.Collections.Generic;using System.Text;namespace rellotgeDigitalAmbAlarma
{class Program{static void Main(string[] args){Console.ForegroundColor =ConsoleColor.Red;Console.BackgroundColor =ConsoleColor.Yellow;Console.Clear();int h, m, s, x;int alarmaH, alarmaM, alarmaS;String alarma;Console.WriteLine("Introdueix leshores");h =Convert.ToInt32(Console.ReadLine());Console.WriteLine("Introdueix elsminuts");m =Convert.ToInt32(Console.ReadLine());Console.WriteLine("Introdueix elssegons");s =Convert.ToInt32(Console.ReadLine());Console.WriteLine("Vols possaralarma, si o no");alarma =Convert.ToString(Console.ReadLine());if (alarma == "si"){Console.Clear();Console.WriteLine("Introdueix leshores de l'alarma");alarmaH =Convert.ToInt32(Console.ReadLine());

Activity (45)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
Miguel Gutierrez liked this
alimber15 liked this
Esmeralda Campos liked this
Franck ZC liked this
Sergio Enrique liked this

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->