zoukankan      html  css  js  c++  java
  • 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
    ", 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;
    }
  • 相关阅读:
    上下伸展的JS菜单
    [ZZ]Debug VBScript with Visual Studio
    面试总结之杂题
    [ZZ]9 Confusing Naming Conventions for Beginners
    Robocopy
    [ZZ]什么是Alpha,Beta,RC,RTM,CTP版
    使用位运算交换两个值,不用临时变量
    学习笔记之编程之美微软技术面试心得(一)
    C#中如何获取系统环境变量
    学习笔记之SQL教程 from W3School
  • 原文地址:https://www.cnblogs.com/pcdl/p/12233216.html
Copyright © 2011-2022 走看看