Cho Toàn đăng lại bài xuất mã ASCII!

1 view
Skip to first unread message

phongbat...@gmail.com

unread,
Sep 11, 2008, 11:53:13 PM9/11/08
to challenge4u
class Program
{
static void Main(string[] args)
{
int x,test='B';
char z,w,y;
x = '0';
y = '0';
z = 'a';
w='A';
for (int i =0 ; i < 99; i++)
{
if (x > '9')
{
if ((x >= 'a') && (x <= 'z'))
{
System.Console.Write("\t\ti={0}", i);
System.Console.Write("\tx={0}", x);
Console.WriteLine("\t\tki tu thuong: {0} co
ma AscII la {1}", z, x);
x = x + 1;
z++;
}
else if ((x >= 'A') && (x <= 'Z'))
{
System.Console.Write("\ti={0}", i);
System.Console.Write("\tx={0}", x);
Console.WriteLine("\tki tu hoa: {0} co ma
AscII la {1}", w, x);
x++;
w++;
}
else
{
x++;
}
}
else
{
System.Console.Write("i={0}", i);
System.Console.Write("\tx={0}", x);
Console.WriteLine("\tKi so: {0} co ma ACII la:{1}",
y, x);
x++;
y++;
}

}
System.Console.WriteLine("Test: ma ASCII B la: {0}", test);
}
}
Reply all
Reply to author
Forward
0 new messages