using System;
using System.Collections.Generic;
public class MyClass
{
public static void Main()
{
Console.Write("A: ");
int A = int.Parse(Console.ReadLine());
Console.Write("B: ");
int B = int.Parse(Console.ReadLine());
int x = A*B;
string S = x.ToString();
string t = A.ToString();
string u = B.ToString();
string Y = S + A;
string y = A + S;
int a = int.Parse(Y);
int b = int.Parse(y);
int Sum = a-b;
Console.WriteLine("{0} - {1} = {2}",a,b,Sum);
Console.ReadLine();
}
}
ข้อ 2
using System;
using System.Collections.Generic;
public class MyClass
{
public static void Main()
{
Console.Write("Score: ");
int Score = int.Parse(Console.ReadLine());
Console.Write("Mean: ");
int Mean = int.Parse(Console.ReadLine());
if(Score>=Mean)
{
if((Score>Mean)&&(Score>=80))
{
Console.WriteLine("Grade A!");
}
else if (Score>Mean)
{
Console.WriteLine("Grade B!");
}
else
{
Console.WriteLine("Grade C!");
}
}
else
{
if((Score<Mean)&&(Score<40))
{
Console.WriteLine("Grade F!");
}
else
{
Console.WriteLine("Grade D!");
}
}
}
}
ข้อ 3
-----
ข้อ 4
---
ข้อ 5
using System;
using System.Collections.Generic;
public class MyClass
{
static int Factorial(int n)
{
int sum = 1;
while (n>0)
{
sum *= n;
n= n-1;
}
return sum;
}
public static void Main()
{
Console.Write("A: ");
int A = int.Parse(Console.ReadLine());
long a = Factorial(A);
Console.Write("B: ");
int B = int.Parse(Console.ReadLine());
long b = Factorial(B);
Console.Write("C: ");
int C = int.Parse(Console.ReadLine());
long c = Factorial(C);
long sum = a+b+c;
if (((A>=0)&&(A<=20))&((B>=0)&&(B<=20))&((C>=0)&(C<=20)))
{
Console.WriteLine("{0}! + {1}! + {2}! = {3}",A,B,C,sum);
}
Console.ReadLine();
}
}
ข้อ 3
using System;
class Program
{
static void Main()
{
A = ;
double B = 1 / 2;
C = ;
D = ;
int E = 1;
if (!(Math.Sin(A) != B || C == D || C))
E--;
Console.WriteLine(E);
}
}
ข้อ อื่น รอไปก่อนนะ บางข้ออาจจะผิดพลาดบ้าง อย่าโวยวาย กำลังแก้ใขอยู๋
ไม่มีความคิดเห็น:
แสดงความคิดเห็น