fork(1) download
  1. // <24127121>
  2. // <Nguyen Tien Thanh>
  3. // <24C09>
  4. //Bai 10
  5.  
  6. //Test case 1
  7. //input: 60 80
  8. //Output: 20
  9.  
  10. //Test case 2
  11. //Input: 70 100
  12. //Output: 30
  13.  
  14. //Test case 3
  15. //Input: 10 100
  16. //Output: 90
  17. #include <iostream>
  18. using namespace std;
  19. int main() {
  20. unsigned int previous, current;
  21. do {
  22. cin >> previous >> current;
  23. if (current > previous) {
  24. unsigned int used = current - previous;
  25. cout << " " << used << endl;
  26. }
  27. else {
  28. cout << "Ban da nhap sai, vui long nhap lai!" << endl;
  29. }
  30. } while (current <= previous);
  31. return 0;
  32. }
Success #stdin #stdout 0s 5320KB
stdin
60 80
stdout
 20