Advertisement
alkelane7

Time

Apr 20th, 2019
628
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4.  
  5. struct time{
  6.  
  7. int year[2],month[2],day[2];
  8.  
  9. int mins[2];
  10. int clk[2];
  11.  
  12.  
  13.  
  14.  
  15. };
  16.  
  17. void dt(){
  18.  
  19. struct time t;
  20.  
  21. for(int i=0;i<2;i++){
  22.  
  23. cout<<"Entre date year/month/day : ";
  24. cin>>t.year[i]>>t.month[i]>>t.day[i];
  25. cout<<"\n Entre time o'clock : minutes ";
  26. cin>>t.clk[i];
  27. cout<<" : ";
  28. cin>>t.mins[i];
  29.  
  30.  
  31.  
  32.  
  33. }
  34.  
  35.  
  36.  
  37. int dif;
  38. dif = t.mins[0] - t.mins[1];
  39.  
  40. cout<<"\n the diffrence between these two times : "<<dif<<" minuites"<<endl;
  41.  
  42.  
  43.  
  44.  
  45.  
  46. }
  47.  
  48. int main()
  49. {
  50.  
  51. dt();
  52.  
  53.  
  54. return 0;
  55.  
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement