@ -1,16 +0,0 @@
|
||||
namespace Lecture.Exercises;
|
||||
|
||||
public class Conversion
|
||||
{
|
||||
public static int StringToInt(string number)
|
||||
{
|
||||
int res = 0;
|
||||
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
res = res * 10 + int.Parse(number[i].ToString());
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
@ -1,2 +0,0 @@
|
||||
Console.WriteLine(Lecture.Exercises.Conversion.StringToInt("123456"));
|
||||
Console.WriteLine(Lecture.Exercises.Conversion.StringToInt("342523"));
|
Reference in New Issue
Block a user