Created
September 10, 2012 14:30
-
-
Save dck-jp/3691179 to your computer and use it in GitHub Desktop.
oppaiAnalysis
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace OppaiAnalysis | |
{ | |
static class OppaiAnalysis | |
{ | |
static public double Cup2Cm(string cup) | |
{ | |
if (cup == "AAA") { return 5; } | |
else if (cup == "AA") { return 7.5; } | |
else if (cup == "ZZ") { return 75; } | |
else if (cup == "ZZZ") { return 77.5; } | |
return (Convert.ToInt32(cup.ToCharArray()[0]) - Convert.ToInt32('A'))*2.5 + 10; | |
} | |
static public string Cm2Cup(double cm) | |
{ | |
if( cm <= 6.25) {return "AAA";} | |
else if( cm <= 8.75){ return "AA";} | |
else if ( cm >= 77.5) {return "ZZZ";} | |
else if ( cm >= 75) { return "ZZ";} | |
return (Convert.ToChar((int)(Math.Floor((cm - 10)/2.5) + 65))).ToString(); | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var realisticSize = OppaiAnalysis.Cup2Cm("C"); | |
Console.WriteLine(realisticSize); // "15" | |
var worldRecord = OppaiAnalysis.Cm2Cup(102.5); | |
Console.WriteLine(worldRecord); // "ZZZ" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment