HDOJ 2164 Rock, Paper, or Scissors?(水题)
来源:互联网 发布:3g移动嵌入式软件开发 编辑:程序博客网 时间:2024/05/22 14:56
HDACM 2164
import java.util.Scanner;public class Main{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); while(n-->0){ int m = sc.nextInt(); int count = 0; for (int i = 0; i < m; i++) { String a = sc.next(); String b = sc.next(); if (a.charAt(0)-b.charAt(0)==-2) { count += 2; continue; } if (a.charAt(0)-b.charAt(0)==-1) { count += 2; continue; } if (a.charAt(0)-b.charAt(0)==3) { count += 2; continue; } if (a.charAt(0)-b.charAt(0)==0) { count ++; continue; } } if (count==m) { System.out.println("TIE"); continue; } if (count>m) { System.out.println("Player 1"); continue; } if (count<m) { System.out.println("Player 2"); continue; } } sc.close(); }}
阅读全文
0 0
- HDOJ 2164 Rock, Paper, or Scissors?(水题)
- HDOJ(HDU) 2164 Rock, Paper, or Scissors?
- Rock, Paper, or Scissors? 2164
- hdu 2164 Rock, Paper, or Scissors?
- JAVA hdu 2164 Rock, Paper, or Scissors?
- HDU2164 Rock, Paper, or Scissors?【水题】
- HDU2164:Rock, Paper, or Scissors?
- 杭电acm-2164 Rock, Paper, or Scissors?
- 1407281127-hd-Rock, Paper, or Scissors.cpp
- Rock-Paper-Scissors
- 【poj2339】Rock, Scissors, Paper
- Rock, Scissors, Paper
- hdoj 1148 Rock-Paper-Scissors Tournament(模拟题)
- poj 2339 Rock, Scissors, Paper
- POJ 2339 Rock, Scissors, Paper
- poj 3917 Rock, Paper, Scissors
- POJ-2339-Rock, Scissors, Paper
- poj 2339 Rock, Scissors, Paper
- 定时任务的时间格式配置
- IO(输入输出)-字节流
- JavaScript 对象(二)
- stmdb与ldmia
- 三、回文数的猜想
- HDOJ 2164 Rock, Paper, or Scissors?(水题)
- 改写二分搜索算法
- FreeMarker
- 热更新学习笔记(三)
- ArcGIS API For JavaScript本地部署
- python-yq-(占位符,list,tuple,条件,循环,dict,set)
- MyEclipse中使用reset hard的教训
- session 和 cookie 的区别
- 操作系统-页面置换算法-先进先出置换算法