poj 1658 Eva's Problem(水题)
一、Description
Input
Output
二、题解
又是水题啊,感觉不能这样下去了,不然我自己也变水了。
三、java代码
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n,i,j,x,y;
int a[]=new int [5];
n=sc.nextInt();
for(j=0;j<n;j++){
for(i=0;i<4;i++){
a[i]=sc.nextInt();
}
x=a[3]-a[2];
y=a[3] / a[2];
if(a[2]-a[1]==x && a[1]-a[0]==x)
a[4]=a[3]+x;
else
a[4]=a[3] *y;
for(i=0;i<=4;i++)
System.out.print(a[i]+" ");
System.out.println();
}
}
}
poj 1658 Eva's Problem(水题)的更多相关文章
- OpenJudge/Poj 1658 Eva's Problem
1.链接地址: http://bailian.openjudge.cn/practice/1658 http://poj.org/problem?id=1658 2.题目: 总时间限制: 1000ms ...
- poj 3080 Blue Jeans(水题 暴搜)
题目:http://poj.org/problem?id=3080 水题,暴搜 #include <iostream> #include<cstdio> #include< ...
- POJ 3984 - 迷宫问题 - [BFS水题]
题目链接:http://poj.org/problem?id=3984 Description 定义一个二维数组: int maze[5][5] = { 0, 1, 0, 0, 0, 0, 1, 0, ...
- hdu-5867 Water problem(水题)
题目链接: Water problem Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Othe ...
- Codeforces - 1194B - Yet Another Crosses Problem - 水题
https://codeforc.es/contest/1194/problem/B 好像也没什么思维,就是一个水题,不过蛮有趣的.意思是找缺黑色最少的行列十字.用O(n)的空间预处理掉一维,然后用O ...
- poj 1007:DNA Sorting(水题,字符串逆序数排序)
DNA Sorting Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 80832 Accepted: 32533 Des ...
- poj 1004:Financial Management(水题,求平均数)
Financial Management Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 126087 Accepted: ...
- POJ 3176 Cow Bowling (水题DP)
题意:给定一个金字塔,第 i 行有 i 个数,从最上面走下来,只能相邻的层数,问你最大的和. 析:真是水题,学过DP的都会,就不说了. 代码如下: #include <cstdio> #i ...
- Poj1207 The 3n + 1 problem(水题(数据)+陷阱)
一.Description Problems in Computer Science are often classified as belonging to a certain class of p ...
随机推荐
- 不怕慢 就怕站 不怕单线程 不怕 裸露ip
import sys import os import requests import threading from time import sleep from bs4 import Beautif ...
- hdoj 1455 Sticks 【dfs】
题意:找最短的木棍可以组成的长度, hdoj 1518 的加强版 代码: #include <stdio.h> #include <string.h> #include &l ...
- ABAP内表数据做层次XML输出
*&---------------------------------------------------------------------**& Report Z_BARRY ...
- 销售订单、外向交货单、交货 bapi
转自[http://www.cnblogs.com/elegantok/archive/2009/10/18/1585398.html]***********SALES ORDER INPUT CRE ...
- ubuntu下使用free命令查看内存实际占用(待补充)
free不带选项运行会显示一个以kb为单位的默认输出 free -h人类能看懂的方式显示 free -m MB的方式显示 free -g GB方式显示 used=total-free即total=us ...
- LeetCode:盛最多水的容器【11】
LeetCode:盛最多水的容器[11] 题目描述 给定 n 个非负整数 a1,a2,...,an,每个数代表坐标中的一个点 (i, ai) .在坐标内画 n 条垂直线,垂直线 i 的两个端点分别为 ...
- python内置方法补充all
all(iterable) 版本:该函数在python2.5版本首次出现,适用于2.5以上版本,包括python3,兼容python3版本. 说明:如果iterable的所有元素不为0.''.Fals ...
- cat echo 打印菜单
cat << END ============================= 1.apple 2.pear 3.banana ...
- python 常用的字符串方法
st = ' hello Kitty 'str = 'hello {name} {age}' #print(st.format(name='fadfa'))#常用的字符串方法print(st.coun ...
- ThinkPHP的Auth类认证
Auth 类已经在ThinkPHP代码仓库中存在很久了,但是因为一直没有出过它的教程, 很少人知道它, 它其实比RBAC更方便 . RBAC是按节点进行认证的,如果要控制比节点更细的权限就有点困难了 ...