Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.55 KB | None | 0 0
  1.     Sat &PostaviNormalizirano(int h, int m, int s)
  2.     {
  3. //  if(DaLiJeIspravno(h,m,s)==false){
  4. //  }
  5.     if(s<0){
  6.             while(s<0){
  7.                 s=s+60;
  8.                 m--;
  9.             }
  10.         //  m--;
  11.         }
  12.         if(s>59){
  13.             while(s>59){
  14.                 s=s-60;
  15.             m++;
  16.             }// m++;
  17.         }
  18.             if(m<0){
  19.             while(m<0){
  20.                 m=m+60;
  21.                 h--;
  22.             }
  23.         //  h--;
  24.         }
  25.         if(m>59){
  26.             while(m>59){
  27.                 m=m-60;
  28.                 h++;
  29.             }
  30.         //  h++;
  31.         }
  32.    
  33.         if(h>23) {
  34.             while(h>23) {
  35.                 h=h-24;
  36.             }
  37.         }
  38.         if(h<0) {
  39.             while(h<0) {
  40.                 h=h+24;
  41.             }
  42.         }
  43.    
  44.         sati=h;
  45.         minute=m;
  46.         sekunde=s;
  47.         return *this;
  48.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement