”杭电OJ“ 的搜索结果

杭电OJ 2014

标签:   杭电

     2016-10-28(已AC)#include<stdio.h>int main(void) { int n, i, a[101], sum, max, min, maxid, minid; double average; while (scanf("%d", &n) != EOF) { sum = 0; for (i = 0; i<n

杭电oj java 1064

标签:   java

     刚学习java,作为练习,先刷杭电题巩固一下知识点 先上代码. import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); double x =...

     import java.util.Scanner; public class Main2020 { public static void main(String[] args) { Scanner sc=new Scanner(System.in); while(sc.hasNext()){ int n=sc.nextInt();... int arr[]=new int[n];...

     杭电oj2629 自己编译运行输出是符合要求的,可是再oj上就是提示输出错误,希望好心人能为我解惑!!! ``` #include #include int main() { int n; char s[20]; int place,birthday,garbage; ...

杭电oj 1003

标签:   acm  蓝桥杯  杭电

       先看题目 Max Sum Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 190877 Accepted Submission(s): 44442 ...Giv

     之前在林大oj上做过这种题,但有所不同,林大oj上给出了,所有可能出现的颜色,而本题颜色种类未给出,所以不能用初始化二维数组,而应将出现的所有颜色存到一个二维数组里,然后再用冒泡法,找出出现次数最多的颜色...

     Given a string containing only ‘A’ - ‘Z’, we could encode it using the following method: Each sub-string containing k same characters should be encoded to “kX” where “X” is the only ...

     Problem Description 假设一个班有n(n<=50)个学生,每人考m(m<=5)门课,求每个学生的平均成绩和每门课的平均成绩,并输出各科成绩均大于等于平均成绩的学生数量。 Input 输入数据有多个测试实例,...

     在讲述DP算法的时候,一个经典的例子就是数塔问题,它是这样描述的: 有如下所示的数塔,要求从顶层走到底层,若每一步只能走到相邻的结点,则经过的结点的数字之和最大是多少? 已经告诉你了,这是个DP的题目,你能...

     杭电oj这道题的解法是要通过字符数组储存数字在进行运算的,同时涉及到数值进位的问题,以下是代提供码参考。 #include<stdio.h>#include<string.h>int...

杭电OJ2029

标签:   算法  杭电OJ2029

     杭电OJ2029 用一下string函数库即可 #include<stdio.h> #include<string.h> int main(){ int n = 0; char a[100]; while(scanf("%d",&n)!=EOF){ getchar(); for(int i =0;i<n;i++){ ...

杭电OJ2005

标签:   算法  程序设计

     杭电OJ 这题关键在于区分年月日的选取 有一定的技巧性 我没做出来 #include<stdio.h> int main(){ int day[12]={31,0,31,30,31,30,31,31,30,31,30,31}; int sum=0,year,month,date=0; while(scanf("%d/%d/...

     逐一从开头与末尾比较字符是否相等 #include<iostream> #include<cstdio> #include<cmath> #include<string> using namespace std; int main(){ int n; cin >... for( j

     A + B Problem II Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 521994 Accepted Submission(s): 99845 Problem Description I have a very simp...

     find your present (2) 题目描述: 在新年聚会上,所有人都会收到一份特殊的礼物。选择轮到你领取自己的礼物了。在桌子上有一大堆礼物,其中只有一个是你的。每个礼物上都标有一个号码。而你的礼物的号码是与...

     #include<iostream> #include<cstring> using namespace std; int main() { int N,n,i,j,k; int count=0;//记录空格分开的字符串中字符个数 char a[1000]; cin>>... n=strle

     #include <iostream> #include <iomanip> using namespace std; int n; double t; double dfs(int k, int money) { double m, tmp; if (k == n) { m = 0.5; tmp = 2 * money;... m)...

杭电OJ 1091(C++)

标签:   c++

     A+B for Input-Output Practice (III) #include<iostream> using namespace std; int main() { int A,B; while(cin>>A>>B) { if(A==0,B==0) break; cout<<...}

     杭电OJ ACM Steps 1.1.1 #include<stdio.h> using namespace std; int main() { int a,b; while(scanf("%d%d",&a,&b)!=EOF){ printf("%d\n",a+b); } } /* 当上面的程序运行时,如果不加" != EOF",...

     人见人爱A-B 题目描述: 参加过上个月月赛的同学一定还记得其中的一个最简单的题目,就是{A}+{B},那个题目求的是两个集合的并集,今天我们这个A-B求的是两个集合的差,就是做集合的减法运算。...

10  
9  
8  
7  
6  
5  
4  
3  
2  
1