POJ-1326
来源:互联网 发布:友价商城源码 编辑:程序博客网 时间:2024/06/05 17:34
import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;public class Main { public static void main(String[] args) { String inLine=""; String flag=""; int miles; String level; int sum=0; BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); while(true){ try{ inLine=br.readLine(); }catch(IOException e){ e.printStackTrace(); } flag=inLine.split(" ")[0]; if(flag.equals("#")){ break; }else if(flag.equals("0")){ System.out.println(sum); sum=0; }else{ miles=Integer.parseInt(inLine.split(" ")[2]); level=inLine.split(" ")[3]; if(level.equals("F")){ sum+=2*miles; }else if(level.equals("B")){ sum+=1.5*miles+0.5; }else if(level.equals("Y")){ if(miles<=500){ sum+=500; }else{ sum+=miles; } } } } }}
0 0
- POJ 1326
- POJ-1326
- POJ 1326 Mileage Bank
- POJ 1326 Mileage Bank
- poj 1326 Mileage Bank
- POJ 1326 算里程
- POJ 1326 Mileage Bank
- POJ
- poj
- POJ
- POJ
- poj
- poj
- POJ
- POJ
- poj
- POJ
- POJ
- [LeetCode]Linked List Cycle
- Android - SimpleAdapter适配器支持的组件及Listview模拟下载
- Codeforces Round #305 (Div. 2) 548D Mike and Feet(单调栈)
- 数据-二分图-F - Air Raid
- 数据结构与算法练习Java版练习1.9和1.10
- POJ-1326
- 两种方式截取字符串
- 开源框架xUtils的学习
- Buttion 按钮事件的简单操作
- poj3177 Redundant Paths 双连通分量
- POJ 2155 Matrix(二维树状数组)
- 静态变量,extern,常量定义
- TCP/IP网络编程读书笔记-简单的套接字编程(1)
- java基本I/O系列--I/O简介