Archived
1
0

Initial commit

This commit is contained in:
2025-10-24 17:19:46 +08:00
commit acc0c9e220
155 changed files with 77369 additions and 0 deletions

38
ConsoleApp6/Program.cs Normal file
View File

@@ -0,0 +1,38 @@
using System;
namespace c.pc
{
public class TemperatureConvertor
{
public static double CtoF(string c)
{
double cl = Double.Parse(c);
double fl = (cl * 9 / 5) + 32;
return fl;
}
public double FtoC(string f)
{
double fl = Double.Parse(f);
double cl = (fl - 32) * 5 / 9;
return cl;
}
}
class Test
{
static void Main()
{
string selection = Console.ReadLine();
double F, C = 0;
TemperatureConvertor tc = new TemperatureConvertor();
switch (selection)
{
case "1":
F = TemperatureConvertor.CtoF(Console.ReadLine()); break;
case "2":
C = tc.FtoC(Console.ReadLine());break;
default:
Console.WriteLine("ERROR");break;
}
Console.WriteLine();
}
}
}