hdu 1000+1089~1096 题解

1000:

英文题目:

 

 

中文题解:

 

 

 题解:

#include<iostream>
using namespace std;

int main()
{
int a, b;
int num = 0;
while (cin >> a >> b)
{
num = a + b;
cout << num << endl;
}
system("pause");
return 0;

}

1089

英文题目:

 

 

 中文题目:

 

 

题解:

#include<iostream>
using namespace std;

int main()
{
    int a, b;
    while (cin >> a >> b)
    {
        cout << a + b << endl;
    }

    system("pause");
    return 0;
}

1090

英文题目:

 

 

 中文题目:

 

 

 题解:

#include<iostream>
using namespace std;

int main()
{
    int a, b;
    int T;
    cin >> T;
    while (T--)
    {
        cin >> a >> b;
        cout << a + b << endl;
    }
    system("pause");
    return 0;
}

1091

英文题目:

 

 中文题目:

 

 题解:

#include<iostream>
using namespace std;

int main()
{
    int a, b;
    while (cin >> a >> b)
    {
        if (a == 0 && b == 0)
        {
            ;
        }else{

            cout << a + b << endl;
            }

    }
    system("pause");
    return 0;
}

1092:

英文题目:

 

 中文题目:

 

 题解:

#include <stdio.h>
#include<stdlib.h>
int main()
{
    int n, number, sum;
    while (scanf("%d", &n), n)
    {
        sum = 0;
        while (n--)
        {
            scanf("%d", &number);
            sum += number;
        }
        printf("%d\n", sum);
    }
    system("pause");
    return 0;
}

1093

英文题目:

 

 中文题目:

 

 题解:

#include<iostream>  
using namespace std;
int main()
{
    int num;
    while (cin >> num)
    {

        int n;
        while ((num--) && (cin >> n))
        {
            if (n != 0)
            {
                int i, sum = 0;
                while ((n--) && (cin >> i))
                {
                    sum += i;
                }
                cout << sum << endl;
            }
            else
                break;
        }
    }
    system("pause");
    return 0;
}

1094

英文题目:

 

 中文题目:

 

 题解:

#include<iostream>
using namespace std;

int main()
{
    int n, num, sum;
    while (cin >> n)
    {
        sum = 0;
        while (n--)
        {
            cin >> num;
            sum += num;
        }
        cout << sum << endl;
    }

    system("pause");
    return 0;
}

1095

英文题解:

 

 中文题解:

 

 题解:

#include<iostream>
using namespace std;
int main()
{
    int a, b;
    while (cin >> a >> b)
    {
        cout << a + b << endl << endl;
    }

    system("pause");
    return 0;
}

1096:

英文题解:

 

 中文题目:

 

 题解:

#include<iostream>
using namespace std;
int main()
{
    int n, t, mun, sum;
    cin >> n;
    while (n--&&cin>>t)
    {
        sum = 0;
        while (t--)
        {
            cin >> mun;
            sum += mun;
        }
        cout << sum << endl << endl;

    }

    system("pause");
    return 0;
}

 

posted @ 2020-01-25 17:26  PCDL&TIPO  阅读(217)  评论(0编辑  收藏  举报