add: 220222 [csharp]
This commit is contained in:
parent
ca1327b9dc
commit
ecb3d135df
|
|
@ -4,6 +4,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "cn-0221", "cn-0221\cn-0221.
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "int-0221", "int-0221\int-0221.csproj", "{9CCC88EF-7FA3-4406-B41B-EAC86AEF8760}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "int-0221", "int-0221\int-0221.csproj", "{9CCC88EF-7FA3-4406-B41B-EAC86AEF8760}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "int-0222", "int-0222\int-0222.csproj", "{70C4BB01-2740-48F5-911A-FEB254C1AAD5}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
|
@ -18,5 +20,9 @@ Global
|
||||||
{9CCC88EF-7FA3-4406-B41B-EAC86AEF8760}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{9CCC88EF-7FA3-4406-B41B-EAC86AEF8760}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{9CCC88EF-7FA3-4406-B41B-EAC86AEF8760}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{9CCC88EF-7FA3-4406-B41B-EAC86AEF8760}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{9CCC88EF-7FA3-4406-B41B-EAC86AEF8760}.Release|Any CPU.Build.0 = Release|Any CPU
|
{9CCC88EF-7FA3-4406-B41B-EAC86AEF8760}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{70C4BB01-2740-48F5-911A-FEB254C1AAD5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{70C4BB01-2740-48F5-911A-FEB254C1AAD5}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{70C4BB01-2740-48F5-911A-FEB254C1AAD5}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{70C4BB01-2740-48F5-911A-FEB254C1AAD5}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
EndGlobal
|
EndGlobal
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
namespace int_0222;
|
||||||
|
|
||||||
|
public class Solution {
|
||||||
|
public int TitleToNumber(string columnTitle) {
|
||||||
|
int ret = 0;
|
||||||
|
foreach (char c in columnTitle)
|
||||||
|
ret = (26 * ret) - 'A' + c + 1;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Runner {
|
||||||
|
public static void Main() {
|
||||||
|
var s = new Solution();
|
||||||
|
Console.WriteLine(s.TitleToNumber("ZY"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<OutputType>Exe</OutputType>
|
||||||
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
|
<RootNamespace>int_0222</RootNamespace>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
Loading…
Reference in New Issue