您的位置:首页 > 其它

计算滞纳金

2013-11-22 13:13 302 查看
static void Main(string[] args)
{
var r = abc(2);
Console.Write(r.Key + "=" + r.Value);
Console.Read();
}

static System.Collections.Generic.KeyValuePair<string,int> abc(int n)
{
n = n + 1;
int k = 25;
string str = "";
int r = 0;
System.Collections.Generic.KeyValuePair<string, int> result;
for (int i = 1; i < n; i++)
{
if (i == 1)
{
str = k.ToString();
r = k;
}
else
{
r = r + k * i;
str = str + "+" + k * i;
}
//Console.WriteLine(str);
}
result = new KeyValuePair<string, int>(str, r);
return result;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: