”HDOJ“ 的搜索结果

     hdoj 1000 注意这里没有要一直输入,所以没有while(true);另外类名必须是Main; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System...

     题目描述 解题思路 //从n==4开始,每一年的牛的数量=前一年的牛的数量+三年前的牛的数量 #include<iostream> using namespace std; int main() { int a[56]; a[1]=1; a[2]=2; a[3]=3;... }...

     HDOJ 1005 Problem Description A number sequence is defined as follows: f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7. Given A, B, and n, you are to calculate the value of f(n)...

     HDOJ 1000 Problem Description Calculate A + B. Input Each line will contain two integers A and B. Process to end of file. Output For each case, output A + B in one line. code import java...

     题目描述 //A, B are hexadecimal number. //A,B为16进制数 解题思路 #include<iostream> #include<cstdio> using namespace std; int main() { int a,b;... //输入16进制要使用%x...

     题目描述 解题思路 #include<iostream> #include<cmath> using namespace std; int main() { int m,n; while(cin>>m>>n) { int sum2=0; int sum3=0; if(n<... i...

     补充知识: c++中float和double的区别 题目描述 解题思路 #include<iostream> #include<cstdio> using namespace std; #define PI 3.1415927 int main() { double r;//用flaot WA ......

     HDOJ 1004 Problem Description Contest time again! How excited it is to see balloons floating around. But to tell you a secret, the judges' favorite time is guessing the most popular problem. When the ...

     problem descripion 我们看到过很多直线分割平面的题目,今天的这个题目稍微有些变化,我们要求的是n条折线分割平面的最大数目。比如,一条折线可以将平面分成两部分,两条折线最多可以将平面分成7部分。...

     hdoj 1017 注意格式 1、给的例子有问题,输入N后不用空一行 2、每一组数据输出后面空一行,最后一组数据除外 代码: import java.util.Scanner; public class Main { public static void main(String[] args...

     HDOJ 2032 杨辉三角 Problem Description 还记得中学时候学过的杨辉三角吗?具体的定义这里不再描述,你可以参考以下的图形: 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 1 5 10 10 5 1 Input 输入数据包含多个测试实例,每个...

     HDOJ 2028 Lowest Common Multiple Plus Problem Description 求n个数的最小公倍数。 Input 输入包含多个测试实例,每个测试实例的开始是一个正整数n,然后是n个正整数。 Output 为每组测试数据输出它们的最小公...

     http://acm.hdu.edu.cn/showproblem.php?pid=1001 # include <stdio.h> int main () { int n; while(scanf("%d",&n) != EOF) { int Sum = 0; for(int i = 1;... ...

     题目链接:... 这个题目里的 简单题。关键是把题目看懂,题目意思是,给出两个数a,b....题目给出的m,n并没说明那个大那个小,应该先判断一下,并且题目也讲清楚了,要求输出的是原来的m,n, ...imp

     HDOJ 2017 字符串统计 Problem Description 对于给定的一个字符串,统计其中数字字符出现的次数。 Input 输入数据有多行,第一行是一个整数n,表示测试实例的个数,后面跟着n行,每行包括一个由字母和数字组成的...

     HDOJ 2016 数据的交换输出 超详细 Problem Description 输入n(n<100)个数,找出其中最小的数,将它与最前面的数交换后输出这些数。 Input 输入数据有多组,每组占一行,每行的开始是一个整数n,表示这个测试实例...

     **字符串数字统计--------------欢迎指导** #include<iostream> #include<string> #include<stdio.h> using namespace std; int main() { char a[1005]; int n,i;... ...

HDOJ 2010 水仙花数

标签:   HDOJ  java

     根据水仙花数的定义,求解就好。 package introduction; import java.util.Scanner; /** * Created by yangyuan on 2017/12/8. */ public class Problem2010 { public static void main(String[] args) ... Sc

     刷了不少剑指offer和leetcode练习...按这个顺序:https://blog.csdn.net/liuqiyao_01/article/details/8477645//hdoj1089 针对行数未知的输入#include <stdio.h>//要有.hint main(){ int a, b; whi...

     HDOJ 2009 求数列的和 Problem Description 数列的定义如下: 数列的第一项为n,以后各项为前一项的平方根,求数列的前m项的和。 Input 输入数据有多组,每组占一行,由两个整数n(n<10000)和m(m<1000)组成...

     我只想说,它不光是水题,还是入门级水题。 做得那个爽啊,7道题只需要10分钟。。... HDOJ 1089 while(scanf(“%d %d”, &a, &b) != EOF) 注:EOF是一个预定义的量,值是-1 2.输入N个 ...

     Problem Description 对于表达式n^2+n+41,当n在(x,y)范围内取整数值时(包括x,y)(-39; class Main{ public static void main(String args[]){ Scanner sc = new Scanner(System.in); while(s

     HDOJ 2002 计算球体积 Problem Description 根据输入的半径值,计算球的体积。 Input 输入数据有多组,每组占一行,每行包括一个实数,表示球的半径。 Output 输出对应的球的体积,对于每组输入数据,输出一行,...

     HDOJ 2010 水仙花数 Problem Description 春天是鲜花的季节,水仙花就是其中最迷人的代表,数学上有个水仙花数,他是这样定义的: “水仙花数”是指一个三位数,它的各位数字的立方和等于其本身,比如:153=1^3+5^3+...

     HDOJ 2019 2019 数列有序 一开始我准备在原数组输出的时候判断大小,但发现要分类讨论很多种情况。。 干脆先排序,再输出。 把新输入的那个数放进原数组,看成一个新的数组,再冒泡排序一下,再输出。 #include<...

     #include<cstdio> #include<cstring> #include&... hdoj 1106 */ using namespace std; char a[1005]; long long b[1005]; //避免分割字符串的取值溢出  int main...

10  
9  
8  
7  
6  
5  
4  
3  
2  
1