zoukankan
html css js c++ java
switch_goto
using
System;
using
System.Collections.Generic;
using
System.Text;
namespace
switch_goto
{
class
SwitchTest
{
static
void
Main()
{
Console.WriteLine(
"
Coffee sizes: 1=Small 2=Medium 3=Large
"
);
Console.Write(
"
Please enter your selection:
"
);
string
s
=
Console.ReadLine();
int
n
=
int
.Parse(s);
int
cost
=
0
;
switch
(n)
{
case
1
:
cost
+=
25
;
break
;
case
2
:
cost
+=
25
;
goto
case
1
;
case
3
:
cost
+=
50
;
goto
case
1
;
default
:
Console.WriteLine(
"
Invalid selection.
"
);
break
;
}
if
(cost
!=
0
)
{
Console.WriteLine(
"
Please insert {0} cents.
"
, cost);
}
Console.WriteLine(
"
Thank you for your business.
"
);
Console.ReadLine();
}
}
}
查看全文
相关阅读:
Android Studio 编译不通过,报错“找不到org.apache.http
Android studio中出现非法字符时的部分解决方法
eclipse项目导入到Android Studio Plugin with id 'android-library' not found
将Eclipse代码导入到AndroidStudio的两种方式
eclipse项目迁移到android studio(图文最新版)
Android studio插件安装
ViewPager PagerAdapter不更新视图
Android:可扩展伸缩listview
Android的崩溃错误报告之ACRA
Android数据库ORMlite框架04
原文地址:https://www.cnblogs.com/simhare/p/919841.html
最新文章
linux svn搭建
linux 防火墙开放特定端口与指定ip谨防
聊天室上线
apache 多端口配置和虚拟主机配置
vim 快捷键
mysql 相关
iOS开发UI篇—通知中心(NSNotificationCenter)
iOS开发UI篇—Date Picker和UITool Bar控件简单介绍
iOS开发UI篇—UIPickerView控件简单介绍
iOS开发UI篇—程序启动原理和UIApplication
热门文章
iOS开发UI篇—常见的项目文件介绍
iOS开发UI篇—在UITableview的应用中使用动态单元格来完成app应用程序管理界面的搭建
iOS开发UI篇—用纯代码写实现图片轮播
iOS开发UI篇—UIScrollView控件实现图片轮播
iOS开发UI篇—使用UItableview完成一个简单的QQ好友列表(二)
iOS开发UI篇—使用UItableview完成一个简单的QQ好友列表(一)
AndroidCharts为折线图表添加y坐标
Android中图表AChartEngine学习使用与例子
MPAndroidChart
appcompat_v7/res/values-v21/themes_base.xml No resource found that matches the given name
Copyright © 2011-2022 走看看