”hdu1001“ 的搜索结果

     java AC代码 import java.io.*; import java.util.Scanner; public class Main{ public static void main(String[] args) { long n,result;... Scanner reader = new Scanner(System.in);... while(rea

HDU-1001

标签:   C  HDU

     题目描述: 解析: 问题就是求和,关键在于求法: 1.直接套求和公式 ... 2....很明显第一种方法的时间复杂度小,但第一种方法在输入过大时计算会产生溢出,因此,在此题中使用第二种方法。... int flag = ...

     Tempter of the BoneTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 143919 Accepted Submission(s): 38404Problem DescriptionThe doggie found a ...

     HDU 1001 题目:计算1+2…+n #include<stdio.h> double add(double open,double n); int main(void){ double open,n; scanf("%lf",&open); scanf("%lf",&n); double sum=add(open,n); printf("sum...

     #include<bits/stdc++.h> using namespace std; int main(){ int a,sum=0; while(scanf("%d",&a)!=EOF){ sum=0; for(int i=0;i<=a;i++){ sum+=i; } cout<<sum<......

     HDU1001 原题为: 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 ...

     Sum Problem Hey, welcome to HDOJ(Hangzhou Dianzi University Online Judge). In this problem, your task is to calculate SUM(n) = 1 + 2 + 3 + … + n. #include <iostream>...

     题目原文如下 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 a series of ...

     HDU1001 Sum Problem <一>基本方法累加法 #include<stdio.h> //基本方法累加法 int main() { int n; while(scanf("%d",&n)!=EOF) { int i; int sum=0; for(i=1;i<=n;i++) sum+=i; printf...

hdu 1001 java版

标签:   hdu  java

     import java.util.Scanner; public class Main { public static void main(String[] args) { long n,sum=0,i; Scanner input=new Scanner(System.in); while(input.hasNext()) ... n=input.nextInt();...

     HDU 1001 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. Sample Input 1 1 Sample ...

10  
9  
8  
7  
6  
5  
4  
3  
2  
1