【发布时间】:2015-02-28 07:41:20
【问题描述】:
好的,这就是我所拥有的,控制台运行并接受任何数字作为第一个输入并输出所有输出,但它会跳过第一个之后的其余读取。我是 C# 的新手,想学习,所以我绝对觉得我在这里错过了一些愚蠢的东西。不要担心目的,因为我只需要帮助解决我现在面临的这个问题。
谢谢大家,
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Stamps
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello, and welcome to the U.S. Mail Stamp Printer. Now, to print the correct stamp for your postage, please enter the number of half ounces (so 1= .5 ounce, 2 = 1 ounce) your package will weigh \n");
double i = Console.Read();
Console.WriteLine("Thank you, now, will you be sending to zone 1, 2, or 3? Simply enter the zone number and press enter\n");
double z = Console.Read();
Console.WriteLine("Great! Now, last question before I print your stamp, will you be using Local Mail or Air Mail, use the number 1 for local and the number 2 for air.\n");
double m = Console.Read();
if (m == 2)
{
double m2 = .95;
}
else
{
double m2 = .49;
}
if( i == 1)
{
double i2 = 1;
}
Console.WriteLine("Press any key to exit.");
Console.ReadKey();
}
}
}
【问题讨论】:
标签: c# input user-input skip