hdu 1000&hdu1001

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);


            }
    }


}

 

posted @ 2016-05-22 09:47  超级学渣渣  阅读(143)  评论(0编辑  收藏  举报