zoukankan      html  css  js  c++  java
  • 引用多个对象的成员

     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 Time
     6 {
     7     public:
     8         int hour;
     9         int minute;
    10         int sec;
    11 };
    12 
    13 int main(int argc, char** argv) {
    14     Time t1;
    15     cin>>t1.hour;
    16     cin>>t1.minute;
    17     cin>>t1.sec;
    18     cout<<t1.hour<<":"<<t1.minute<<":"<<t1.sec<<endl;
    19     
    20     Time t2;
    21     cin>>t2.hour;
    22     cin>>t2.minute;
    23     cin>>t2.sec;
    24     cout<<t2.hour<<":"<<t2.minute<<":"<<t2.sec<<endl;
    25     return 0;
    26 }
  • 相关阅读:
    es6
    ES6
    ES6
    css3
    滚动穿透的6种解决方案【已自测】
    css特效
    css布局
    css布局
    js
    【消灭代办】第5周
  • 原文地址:https://www.cnblogs.com/borter/p/9401845.html
Copyright © 2011-2022 走看看