Notes
![]() ![]() Notes - notes.io |
int sayi;
Console.Write("4 basamaklı sayı giriniz : ");
sayi = Convert.ToInt16(Console.ReadLine());
switch (sayi / 1000)//binler basamağı
{
case 1: Console.Write(" bin"); break;
case 2: Console.Write(" ikibin"); break;
case 3: Console.Write(" üçbin"); break;
case 4: Console.Write(" dörtbin"); break;
case 5: Console.Write(" beşbin"); break;
case 6: Console.Write(" altıbin"); break;
case 7: Console.Write(" yedibin"); break;
case 8: Console.Write(" sekizbin"); break;
case 9: Console.Write(" dokuzbin"); break;
default: break;
}
switch ((sayi / 100) % 10)//yüzler basamağı
{
case 1: Console.Write(" yüz"); break;
case 2: Console.Write(" ikiyüz"); break;
case 3: Console.Write(" üçyüz"); break;
case 4: Console.Write(" dörtyüz"); break;
case 5: Console.Write(" beşyüz"); break;
case 6: Console.Write(" altıyüz"); break;
case 7: Console.Write(" yediyüz"); break;
case 8: Console.Write(" sekizyüz"); break;
case 9: Console.Write(" dokuzyüz"); break;
default: break;
}
switch ((sayi / 10) % 10) // onlar basamağı
{
case 1: Console.Write(" on"); break;
case 2: Console.Write(" yirmi"); break;
case 3: Console.Write(" otuz"); break;
case 4: Console.Write(" kırk"); break;
case 5: Console.Write(" elli"); break;
case 6: Console.Write(" atmış"); break;
case 7: Console.Write(" yetmiş"); break;
case 8: Console.Write(" seksen"); break;
case 9: Console.Write(" doksan"); break;
default: break;
}
switch (sayi % 10) // birler basamağı
{
case 1: Console.Write(" bir"); break;
case 2: Console.Write(" iki"); break;
case 3: Console.Write(" üç"); break;
case 4: Console.Write(" dört"); break;
case 5: Console.Write(" beş"); break;
case 6: Console.Write(" altı"); break;
case 7: Console.Write(" yedi"); break;
case 8: Console.Write(" sekiz"); break;
case 9: Console.Write(" dokuz"); break;
default: break;
}
Console.ReadLine();
*/
/* bir otoparka en fazla 10 araç girebiliyor.
içeride kaç araba var kontrol etsin 10 dan fazla olmasın 0 dan az olmasın
+ ya basınca 1 artıyor - ye basınca 1 eksliyor.içeride kaç araç olduğunu göstersin
int arac;
string durum = "";
do
{
Console.Write("içeride kaç araba var: ");
arac = Convert.ToInt16(Console.ReadLine());
}
while (arac > 10 || arac < 0);
while (durum != ".")
{
Console.WriteLine("araç ekle [+] araç çıkar [-] programı bitir [.]");
durum = Console.ReadLine();
if (durum == "+")
{
if (arac < 10)
{
arac++;
Console.WriteLine("içeride {0} araç var ", arac);
}
else
{
Console.WriteLine("10 dan fazla araç girilemez");
}
}
if (durum == "-")
{
if (arac > 0)
{
arac--;
Console.WriteLine("içeride {0} araç var ", arac);
}
else
{
Console.Write("0 dan az araç olamaz");
}
}
}
*/
/* 2 kişi 2 şer tane zar atıyor.Büyük atan kazanacak,sayılar eşitse yeniden atmak istiyor musun diye soracak
int Atoplam = 0, Btoplam = 0;
string durum = "E";
while (durum == "E")
{
Random zar1 = new Random();
int Azar1 = zar1.Next(1, 6);
Random zar2 = new Random();
int Azar2 = zar2.Next(1, 6);
Random zar3 = new Random();
int Bzar1 = zar1.Next(1, 6);
Random zar4 = new Random();
int Bzar2 = zar2.Next(1, 6);
Atoplam = Azar1 + Azar2;
Btoplam = Bzar1 + Bzar2;
if (Atoplam > Btoplam)
{
Console.Write("A kazandı ");
}
else if (Btoplam > Atoplam)
{
Console.Write("B kazandı ");
}
else
{
Console.Write("zarların toplamı eşit");
}
Console.Write(" tekrar oynamak ister misiniz ? [E] [H]");
durum = Console.ReadLine();
}
*/
/*
int puan=0;
string sec="E";
while (sec == "E")
{
Random rdn = new Random();
int sayi1 = rdn.Next(1000, 9999);
int sayi2 = rdn.Next(1000, 9999);
int toplam = sayi1 + sayi2;
Console.Write("sayı1: {0} + sayi2:{1} = ", sayi1, sayi2);
Console.Write("toplam tahminizi yazın : ");
int tahmin = Convert.ToInt32(Console.ReadLine());
if (toplam == tahmin)
{
puan = puan + 5;
Console.Write("TEBRİKLER BİLDİNİZ puanınız {0} ", puan);
}
else
{
puan = puan - 10;
Console.Write("YANLIŞ CEVAP puanınız {0} ", puan);
}
Console.Write(" tekrar oynamak ister misiniz ? [E] [H]");
sec = Console.ReadLine();
}
Console.Write("OYUN BİTTİ PUANINIZ: {0}", puan);
Console.ReadLine();
*/
/* rastgele 1 ile 1000 arasında sayı girilecek kullanıcı sayıyı tahmin edecek doğru tahmin ederse aşağı
yanlış tahmin ederse yukarı yazacak 10 hakkı var
int i = 0;
Random rdn = new Random();
int sayi = rdn.Next(1,1000);
while (i < 10)
{
Console.Write("sayıyı tahmin ediniz: ");
int tahmin = Convert.ToInt16(Console.ReadLine());
if (sayi < tahmin)
{
Console.WriteLine("yanlış tahmin daha düşük sayı giriniz : ");
}
else if (sayi > tahmin)
{
Console.WriteLine("yanlış tahmin daha yüksek sayı giriniz : ");
}
else
{
Console.WriteLine("tebrikler doğru bildiniz : "+i);
}
i++;
if(i>10)
{
Console.Write("hakkınız bitti");
}
}
Console.ReadLine();
*/
int avci, domuz;
Random rdn = new Random();
int zırh1 = rdn.Next(12, 18);//avcı zırhı
int hasar1 = rdn.Next(1, 6);//avcı hasarı
int can1 = rdn.Next(25, 30);//avcının canı
int zırh2 = rdn.Next(14, 18);//domuzun zırhı
int hasar2 = rdn.Next(1, 3);//domuzun hasarı
int can2 = rdn.Next(18,22);//domuzun canı
do
{
int atak1 = rdn.Next(1, 20);//avcı atağı
int atak2 = rdn.Next(1, 20);//domuzun atağı
if (atak1 > zırh2) // avcının atağı domuzun zırhından büyük
{
Console.WriteLine("avcının atağı: {0} domuzun zırhı {1} verilen hasar {2} domuzun kalan can {3}", atak1, zırh2, hasar1, can2);
can2 = can2 - hasar1;// domuzun canı azalıyor
}
else if (atak1 < zırh2)//avcının atağı domuzun zırhından küçük
{
Console.WriteLine("avcının atağı: {0} domuzun zırhı {1} avcının canı {2} domuzun canı {3} ISKALADI ", atak1, zırh2,can1,can2);
}
else
{
Console.WriteLine("ıskaladı ");
}
Console.ReadLine();
if (atak2 > zırh1) // domuzun atağı avcının atağından büyük
{
Console.WriteLine("domuzun atağı: {0} avcının zırhı {1} verilen hasar {2} avcının kalan can {3}", atak2, zırh1, hasar2, can1);
can1 = can1 - hasar2;// avcının canı azalıyor
}
else if (atak2 < zırh1)//domuzun atağı avcının zırhından küçük
{
Console.WriteLine("domuzun atağı: {0} avcının zırhı {1} domuzun canı {2} avcının canı {3} ISKALADI", atak2, zırh1,can2,can1);
}
else
{
Console.WriteLine("ıskaladın ");
}
}
while (can1 > 0 && can2 > 0);
Console.ReadLine();
![]() |
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team