Advertisement
ImoogiWild

Bài nâng cao 1

Oct 21st, 2019
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. #include <iostream>
  2. #include <ctime>
  3. using namespace std;
  4. int main(){
  5.     time_t now = time(0);
  6.     tm *ltm = localtime(&now);
  7.     int year_added;
  8.     int Cur_year = (1900 + ltm->tm_year);
  9.     cout<<"Nhap nam sinh vao : ";
  10.     cin>>year_added;
  11.     cout << Cur_year - year_added;
  12.    
  13.    
  14.     return 0;
  15.      }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement