Advertisement
nisvet_m

Untitled

Dec 1st, 2015
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void main() {
  5.  
  6. int mjesec = 0, pitanje = 0;
  7. cout << "Unesi oznaku mjeseca: ";
  8. cin >> mjesec;
  9.  
  10. switch (mjesec){
  11. case 1:
  12. case 3:
  13. case 5:
  14. case 7:
  15. case 8:
  16. case 10:
  17. case 12: cout << "Ovaj mjesec ima 31 dan." << endl;
  18. break;
  19. case 4:
  20. case 6:
  21. case 9:
  22. case 11: cout << "Ovaj mjesec ima 30 dana." << endl;
  23. break;
  24. case 2:
  25.  
  26. cout << "\nDa li je godina prestupna? (1 znaci DA, 0 znaci NE): ";
  27. cin >> pitanje;
  28.  
  29. if (pitanje == 1) {
  30. cout << "\nOvaj mjesec ima 29 dana." << endl;
  31. }
  32. else if (pitanje == 0) {
  33. cout << "\nOvaj mjesec ima 28 dana." << endl;
  34. }
  35. else {
  36. cout << "Pazi sta pises!" << endl;
  37. }
  38. break;
  39. default: cout << "Niste unijeli dobru oznaku!" << endl;
  40. break;
  41. }
  42.  
  43. system("pause>0");
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement