c#中的应输入类型,命名空间定义或文件尾的错误
usingSystem;usingSystem.Collections.Generic;usingSystem.Text;namespaceConsoleApplicat...
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
double balance, interestRate, targetBalance;
Console.WriteLine("what is your current balance?");
balance = Convert.ToDouble(Console.ReadLine());
Console.WriteLine("what is your current annual interest rate (in %)?");
interestRate = 1 + Convert.ToDouble(Console.ReadLine()) / 100.0;
Console.WriteLine("what balance would you like to have?");
targetBalance = Convert.ToDouble(Console.ReadLine());
int totalYears = 0;
do
{
balance *= interestRate;
++totalYears;
}
while (balance < targetBalance);
Console.WriteLine("In {0} year{1} you'll have a balance of {2}.", totalYears, totalYears == 1 ? "" : "s", balance);
Console.ReadKey();
}
}
}
}
说应输入类型,命名空间定义或文件尾的错误,在第33行,第一列 是什么原因?
麻烦大家帮我看看,没有分了,但是谢谢大家~! 展开
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
double balance, interestRate, targetBalance;
Console.WriteLine("what is your current balance?");
balance = Convert.ToDouble(Console.ReadLine());
Console.WriteLine("what is your current annual interest rate (in %)?");
interestRate = 1 + Convert.ToDouble(Console.ReadLine()) / 100.0;
Console.WriteLine("what balance would you like to have?");
targetBalance = Convert.ToDouble(Console.ReadLine());
int totalYears = 0;
do
{
balance *= interestRate;
++totalYears;
}
while (balance < targetBalance);
Console.WriteLine("In {0} year{1} you'll have a balance of {2}.", totalYears, totalYears == 1 ? "" : "s", balance);
Console.ReadKey();
}
}
}
}
说应输入类型,命名空间定义或文件尾的错误,在第33行,第一列 是什么原因?
麻烦大家帮我看看,没有分了,但是谢谢大家~! 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询