zoukankan      html  css  js  c++  java
  • c++ 程序

    点滴积累,路虽远,行必至!

    程序1,将2个结构域值相加,乘以2再加50

    #include<iostream>
    
    using namespace std;
    int result(int, int);
    const int k = 2;
    struct point{
        int x, y;
    };
    
    int main()
    {
        int z(0), b(50);
        point a;
        cout << "请输入2个整数(以空格分割):";
        cin >> a.x >> a.y;
        z = (a.x + a.y) * k;
        z = result(z, b);
        cout << "输出结果如下:" << endl;
        cout << "(" << a.x << "+"
            << a.y << ")" << "*"
            << k << "+" << b << "=" << z
            << endl;
        return 0;
    }
    int result(int a, int b)
    {
        int c(0);
        c = a + b;
        return c;
    }

    end!

  • 相关阅读:
    js5
    js4
    js(3)
    JS内容(2)
    html复习
    js介绍及内容(1)
    定位2
    position定位
    CSS
    列表及行块转变
  • 原文地址:https://www.cnblogs.com/changbo/p/5205005.html
Copyright © 2011-2022 走看看