fork download
  1. #include <iostream>
  2. #include <cmath>
  3. #include <cstdlib>
  4. #include <string>
  5. #include <ctime>
  6.  
  7. using namespace std;
  8.  
  9. int main() {
  10. int credHours;
  11. int studyTime;
  12. int userInput;
  13. int actualStudyTime;
  14.  
  15. cout << "How many credit hours are you taking?" << endl;
  16.  
  17. cin >> credHours;
  18.  
  19. studyTime = credHours * 3;
  20.  
  21. cout << "Study Time: " << studyTime << endl;
  22.  
  23. cout << "How many hours do you actually spend studying?" << endl;
  24.  
  25. cin >> userInput;
  26.  
  27. actualStudyTime = studyTime - userInput;
  28.  
  29. cout << "Difference: " << actualStudyTime << endl;
  30.  
  31. return 0;
  32. }
Success #stdin #stdout 0s 4176KB
stdin
Standard input is empty
stdout
How many credit hours are you taking?
Study Time: -68663520
How many hours do you actually spend studying?
Difference: -68696286