Advertisement
Guest User

Untitled

a guest
Apr 18th, 2014
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #include <cstdlib>
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. int main(int argc, char *argv[])
  7. {
  8.  
  9. int x;
  10.  
  11. cout << "Indtast en værdi: ";
  12. cin >> x;
  13.  
  14. if (x <= 45)
  15. {
  16. cout << "Spændingen er 4,7v" << endl;
  17. }
  18. if (x > 45 && x <= 60)
  19. {
  20. cout << "Spændingen er 5,0v" << endl;
  21. }
  22. if (x > 60 && x <= 100)
  23. {
  24. cout << "Spændingen er 5,2v" << endl;
  25. }
  26. if (x > 100)
  27. {
  28. cout << "Slukker systemet" << endl;
  29. return 0;
  30. }
  31.  
  32. system("Pause");
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement