Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sat &PostaviNormalizirano(int h, int m, int s)
- {
- // if(DaLiJeIspravno(h,m,s)==false){
- // }
- if(s<0){
- while(s<0){
- s=s+60;
- m--;
- }
- // m--;
- }
- if(s>59){
- while(s>59){
- s=s-60;
- m++;
- }// m++;
- }
- if(m<0){
- while(m<0){
- m=m+60;
- h--;
- }
- // h--;
- }
- if(m>59){
- while(m>59){
- m=m-60;
- h++;
- }
- // h++;
- }
- if(h>23) {
- while(h>23) {
- h=h-24;
- }
- }
- if(h<0) {
- while(h<0) {
- h=h+24;
- }
- }
- sati=h;
- minute=m;
- sekunde=s;
- return *this;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement