daily pastebin goal
25%
SHARE
TWEET

Untitled

a guest Mar 21st, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class Agol {
  5.     private:
  6.     int deg, min, sec;
  7.     public:
  8.     void set_stepeni(int d)
  9.     {
  10.         deg=d;
  11.     }
  12.     void set_minuti(int m)
  13.     {
  14.         min=m;
  15.     }
  16.     void set_sekundi(int s)
  17.     {
  18.         sec=s;
  19.     }
  20.     int to_sekundi()
  21.     {
  22.         return sec+min*60+deg*3600;
  23.     }
  24. };
  25.  
  26. int proveri(int deg, int min, int sec)
  27. {
  28.     if(deg>360 || min>=60 || sec>=60)
  29.     {
  30.         return 0;
  31.     }
  32.     return 1;
  33. }
  34.  
  35. int main()
  36. {    
  37.     Agol a1;
  38.     int deg, min, sec;
  39.     cin >> deg >> min >> sec;
  40.     if(proveri(deg, min, sec)) {
  41.         a1.set_stepeni(deg);
  42.         a1.set_minuti(min);
  43.         a1.set_sekundi(sec);
  44.         cout<<a1.to_sekundi();
  45.     }
  46.     else
  47.     {
  48.         cout<<"Nevalidni vrednosti za agol"<<endl;
  49.     }
  50.     return 0;
  51. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top