电话怎么写程序

电话怎么写程序,第1张

既然是小程序嘛槐搭念~~~~简简单单啦,O(∩_∩)O哈哈~

package testPackage

import java.io.BufferedReader

import java.io.IOException

import java.io.InputStreamReader

import java.util.HashMap

import java.util.Map

public class Main {

/**

* @param args

*/

public static void main(String[] args)

{

Map<String, String>telBook = new HashMap<String, String>铅困()

String name = ""

String tel = ""

String input = ""

for()

{

try {

System.out.println("选择命令:1、输入电话记录;2、查询枝橘电话薄记录;3、退出")

input = (new BufferedReader(new InputStreamReader(System.in))).readLine()

} catch (IOException e) {

e.printStackTrace()

}

try {

switch(Integer.parseInt(input))

{

case 1:

try {

System.out.print("姓名:")

input = (new BufferedReader(new InputStreamReader(System.in))).readLine()

name = input

System.out.print("电话:")

input = (new BufferedReader(new InputStreamReader(System.in))).readLine()

tel = input

} catch (IOException e) {

e.printStackTrace()

}

try {

telBook.put(name, tel)

} catch (RuntimeException e) {

e.printStackTrace()

}

break

case 2:

try {

System.out.print("姓名:")

input = (new BufferedReader(new InputStreamReader(System.in))).readLine()

System.out.println(input + "的电话号码是:" + (String)(telBook.get(input)))

} catch (IOException e) {

e.printStackTrace()

}

break

case 3:

System.out.print("谢谢使用!")

System.exit(0)

break

default: break

}

} catch (Exception e) {

System.out.println("请输入正确的选择项!")

}

}

}

}

无聊之作……

a=inputbox("纯派请输做帆贺入时间","提示")

if a="" then exit sub

b=iif(a<3,0.5,(a-3)*0.15+0.5)

if hour(time)<7 or hour(time)>19 then b=b/2

msgbox "话费为:"轿猛 &b


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/yw/12343658.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-05-22
下一篇2023-05-22

发表评论

登录后才能评论

评论列表(0条)

    保存