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();
}
}
}
查看全文
相关阅读:
考试心得 模拟18
模拟17 题解
模拟16 题解
考试心得 模拟17
模拟15 题解(waiting)
BZOJ2653 middle 【主席树】【二分】*
BZOJ3932 CQOI2015 任务查询系统 【主席树】
与或 【线段树】 *
BZOJ1014 JSOI2008 火星人prefix 【非旋转Treap】*
网络流--最大权闭合子图 *
原文地址:https://www.cnblogs.com/simhare/p/919841.html
最新文章
cf1073D Berland Fair (二分答案+树状数组)
luogu3188/bzoj1190 梦幻岛宝珠 (分层背包dp)
[Noip2011] Mayan游戏
[Noip2011] 观光公交
[Noip2013] 货车运输
[BZOJ4481] [Jsoi2015]非诚勿扰
[Luogu2045] 方格取数加强版
[BZOJ4521] [Cqoi2016]手机号码
[BZOJ4318] OSU!
[BZOJ3029] 守卫者的挑战
热门文章
[POJ2288] Islands and Bridges
[Luogu2593] [ZJOI2006]超级麻将
[Luogu3112] [USACO14DEC]后卫马克Guard Mark
[51nod 1327] 棋盘游戏
[CF468D] Tree
[Noip 2015] 斗地主
[Noip2012] 疫情控制
考试心得 模拟20+21
考试心得 模拟19
模拟18 题解
Copyright © 2011-2022 走看看