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();
}
}
}
查看全文
相关阅读:
阿里云服务器,http免费转https详细教程
springboot系列总结(二)---springboot的常用注解
springboot系列总结(一)---初识springboot
java 查询当天0点0分0秒
mysql各个版本驱动jar包下载 mysql/mysql-connector-java/5.1.22
泰坦尼克 学习
切片
忽略warning 警告
迭代 递归 循环 遍历
标准化 归一化
原文地址:https://www.cnblogs.com/simhare/p/919841.html
最新文章
Angular ng-repeat 对象和数组遍历
快排 quicksort 快速排序
CSS Flex
jQuery 插件入门
AngularJS bootStraping
根据IP地址获得地理位置
C#对数字添加逗号,千分位
快乐大本营项目总结
用反射,将DataRow行转为Object对象
C#压缩与解压
热门文章
登录退出代码
小数点四舍五入
C#加密与解密
解 自己关于 C# Button的Click事件的疑惑
Java内部类——局部内部类
2019.2最新idea下载安装破解
@RequestParam注解的详细介绍
同一服务器部署多个tomcat时的端口号修改详情
Linux压缩解压 tar.gz格式的文件.查看tomcat是否运行
java 后台解密小程序前端传过来的信息,解密手机号
Copyright © 2011-2022 走看看