fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int t, m, n;
  7. cin>>t;
  8.  
  9. if (t <= 10){
  10. for (int i = 1; i <= t; i++)
  11. {
  12. cout<<endl;
  13. cin>>m>>n;
  14. if (m <= n)
  15. {
  16. for (int j = m; j <= n; j++)
  17. {
  18. if (j%2==0)
  19. {
  20. cout<<j<<" ";
  21. }
  22. }
  23. }else{
  24. cout<<"Angka ke 1 tidak boleh lebih kecil sama dengan angka ke 2";
  25. }
  26.  
  27. }
  28.  
  29. }
  30. else{
  31. cout<<"Batas test case tidak boleh lebih dari 10";
  32. }
  33. return 0;
  34. }
  35.  
Success #stdin #stdout 0s 4672KB
stdin
3
14 20
5 19
13 18
stdout
14 16 18 20 
6 8 10 12 14 16 18 
14 16 18