⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pku1663.java

📁 这是ACM 方面的资料 是PKU的 北京大学的出来的
💻 JAVA
字号:
import java.io.*;
import java.util.*;
public class Main
{
	public static void main(String args[])throws Exception
	{
		Scanner cin=new Scanner(System.in);
		int n,i;
		int x,y;
		n=cin.nextInt();
		for(i=0;i<n;i++)
		{
			x=cin.nextInt();
			y=cin.nextInt();
			if(x!=y&&x-2!=y) System.out.println("No Number");
			else 
			{
				if(x==y)
				{
					if(x%2==0)
					System.out.println(2*x);
					else
					System.out.println(x/2*4+1);
				}
				if(x!=y)
				{
					if(x%2==0)
					System.out.println(2*x-2);
					else
					System.out.println(x/2*4-1);
				}
			}
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -