首页 > 其他 > 详细

hdu 1000&hdu1001

时间:2016-05-22 10:51:56      阅读:122      评论:0      收藏:0      [点我收藏+]

1001

#include<iostream>
#include<stdio.h>
using namespace std;
int main()
{
    long long n;
    while(~scanf("%I64d",&n))
    {
        printf("%I64d\n\n",((1+n)*n)>>1);
    }
    return 0;
}

 

1000

import java.io.*;
import java.math.BigInteger;
import java.util.*;
public class hdu1000 {

    public static void main(String[] args) {
        // TODO Auto-generated method stub
         Scanner cin=new Scanner (new BufferedInputStream(System.in));
            PrintWriter cout=new PrintWriter(System.out);

            while(cin.hasNextBigInteger())
            {
                BigInteger t=cin.nextBigInteger();
                BigInteger m=cin.nextBigInteger();
                BigInteger ans =0;
                ans=t.add(m);
                System.out.println(ans);


            }
    }


}

 

hdu 1000&hdu1001

原文:http://www.cnblogs.com/superxuezhazha/p/5516197.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!