Advertisement
Dani_info

nr zilei din an

Oct 19th, 2017
108
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int a, n, l
  8. =1;
  9. cout<<"Introduceti ziua cu numarul:";cin>>n;
  10. if(n<1)
  11. cout<<"Nu exista o astfel de zi;introduceti alta data";
  12. if(n>365)
  13. cout<<"Nu exista o astfel de zi;introduceti alta data";
  14. else
  15. {
  16. a=n/31;
  17. if(n%31>0)
  18. cout<<"Luna este:"<<l+a;
  19. else
  20. l=a;
  21. cout<<"Luna este:"<<a;
  22.  
  23.  
  24.  
  25.  
  26. }
  27. return 0;
  28. }
Advertisement
RAW Paste Data Copied
Advertisement