”HDOJ“ 的搜索结果

     #include #include #include <string.h> using namespace std; int main(){ char a[3]; int x; while(cin>>a){ x=strlen(a); sort(a, a+x); for (int i=0; i<x-1; i++) { ...pr...

HDOJ 1005

标签:   hdoj  c++  algorithm

     HDOJ 1005: Number Sequence problem     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 ...

     View Code 1 /* 2 A + B Problem 3 4 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) ... 5 Total Submission(s): 242043 Accepted Submission(s): 71455...

HDOJ 2041超级楼梯

标签:   算法  c++

     杭电oj2041超级楼梯原题链接 题目描述: 思路:找规律,斐波那契数列,f(n) = f(n-1) + f(n-2) AC代码: #include <iostream> using namespace std; const int M = 45; long long arr[M];... f

     Problem : 1114 ( Piggy-Bank ) Judge Status : Accepted RunId : 2598486Language : G++Author : huwenbiao Code Render Status : Rendered By HDOJ G++ Code Render Version 0.01 Beta /**********...

hdoj 1418

标签:   hdoj  1418

     抱歉 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 6019 Accepted Submission(s): 2824 Problem Description 非常抱歉,本来兴冲冲地搞一场练习赛...

hdoj 1408

标签:   hdoj  1408

     盐水的故事 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 24542 Accepted Submission(s): 6114 Problem Description 挂盐水的时候,如果滴起来有...

     HDOJ 1002 Problem Description I have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B. Input The first line of the input contains an integer T...

HDOJ #2024

标签:   HDOJ水题

     HDOJ #2024(C语言合法标识符) AC code: #include<stdio.h> #include<string.h> int main() { int i,n,len,sum; char arr[53]; while(scanf("%d",&n)!=EOF) { getchar(); ...

     hdoj 1012 阶乘和求和,各位为保留9位小数,注意到前3个比较特别,直接输出结果; public class Main { public static void main(String[] args) { double [] e = new double[10]; e[0] = 1; e[1] = 2; e[2]...

     HDOJ 1064 Financial Management Problem Description Larry graduated this year and finally has a job. He’s making a lot of money, but somehow never seems to have enough. Larry has decided that he ...

     模拟乘法的过程。 例如,1234 x 67,手动计算,有两种方法。 方法一:先用7乘以1234,再用60乘以1234,然后再将两个结果相加。 方法二:先后用67乘以4、3、2、1. 所以,方法二更容易用代码实现。...

     题目描述 补充知识-杨辉三角 (1)每行端点与结尾的数为1. (2)每个数等于它上方两数之和。 解题思路 #include<iostream> using namespace std; int main() { int a[31][31];... a[i][0...

     题目描述 解题思路 #include<iostream> #include<string> #include<cstring> using namespace std; //小写字母转换为大写字母 void change(char &a) ... while(cin.get...

     题目描述 解题思路 #include<iostream> #include<cstring> using namespace std; int main() { int n; cin>>n; char str[1001]; getchar();//吸收回车键 for(int i=0;... cin...

     HDOJ 2003 求绝对值 Problem Description 求实数的绝对值。 input 输入数据有多组,每组占一行,每行包含一个实数。 Output 对于每组输入数据,输出它的绝对值,要求每组数据输出一行,结果保留两位小数。 Sample...

     hdoj 1002 这个题目主要还是注意格式吧。注意有 while (sc.hasNext()) 的存在,就会一直等待输入; 代码如下: import java.math.BigDecimal; import java.util.Scanner; public class Main { public static ...

     HDOJ 2000 ASCII码排序 Problem Description 输入三个字符后,按各字符的ASCII码从小到大的顺序输出这三个字符。 Input 输入数据有多组,每组占一行,有三个字符组成,之间无空格。 Output 对于每组输入数据,输出...

     hdoj 2015 参考了别人的代码,采用一次遍历,思路很清晰; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (sc....

     HDOJ 1001 Problem Description Hey, welcome to HDOJ(Hangzhou Dianzi University Online Judge). In this problem, your task is to calculate SUM(n) = 1 + 2 + 3 + ... + n. Input The input will consist of ...

HDOJ1008 Elevator

标签:   HDOJ

     HDOJ1008 题目 Problem Description The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will ...

     求两个坐标点之间的距离,注意打印的小数点位数就好。 /** * Created by YangYuan on 2017/12/8. */ public class Problem2001 { public static void main(String[] args) ... Scanner scanner = new Scanner...

     HDOJ 2004 成绩转换 Problem Description 输入一个百分制的成绩t,将其转换成对应的等级,具体转换规则如下: 90~100为A; 80~89为B; 70~79为C; 60~69为D; 0~59为E; input 输入数据有多组,每组占一行,由一个整数...

     HDOJ 2030 汉字统计 Problem Description 统计给定文本文件中汉字的个数。 Input 输入文件首先包含一个整数n,表示测试实例的个数,然后是n段文本。 Output 对于每一段文本,输出其中的汉字的个数,每个测试实例的...

     标题HDOJ 2026 首字母变大写 Problem Description 输入一个英文句子,将每个单词的第一个字母改成大写字母。 Input 输入数据包含多个测试实例,每个测试实例是一个长度不超过100的英文句子,占一行。 Output 请...

     题目链接HDOJ1735-字符统计 个人感觉假如最后一段假如全0怎么算?就是未到n行结果之后全为0,那应该至少前几行满字,最后一行一个字。但测得数据并无这种情况。另一点是假如污染后的段数反而小于总段落数不是无解了...

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

10  
9  
8  
7  
6  
5  
4  
3  
2  
1