zoukankan      html  css  js  c++  java
  • 学习 C++,关键是要理解概念,而不应过于深究语言的技术细节

    学习 C++
    学习 C++,关键是要理解概念,而不应过于深究语言的技术细节。

    学习程序设计语言的目的是为了成为一个更好的程序员,也就是说,是为了能更有效率地设计和实现新系统,以及维护旧系统。

    C++ 支持多种编程风格。您可以使用 Fortran、C、Smalltalk 等任意一种语言的编程风格来编写代码。每种风格都能有效地保证运行时间效率和空间效率。

     1 #include <iostream>
     2 
     3 /* run this program using the console pauser or add your own getch, system("pause") or input loop */
     4 using namespace std;
     5 class Student
     6 {
     7     private:
     8         int num;
     9         int score;
    10     public:
    11         void setdata()
    12         {
    13             cin>>num;
    14             cin>>score;
    15         }
    16         void display()
    17         {
    18           cout <<"num="<<num<<endl;
    19           cout <<"score="<<score<<endl;
    20         };
    21 };
    22 
    23 Student stud1,stud2;
    24 int main(int argc, char** argv) {
    25     
    26     stud1.setdata();
    27     stud2.setdata();
    28     stud1.display();
    29     stud2.display();
    30     return 0;
    31 }
  • 相关阅读:
    原生js系列 删除元素
    事件绑定的几种方式
    js的五种输出方式
    三、浏览器事件处理机制--事件循环(event loop)
    二、事件流、事件代理
    一、事件的分类
    js数据类型转换
    html锚点
    观察者模式
    策略模式
  • 原文地址:https://www.cnblogs.com/borter/p/9400716.html
Copyright © 2011-2022 走看看