fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int n;
  8. cin>>n;
  9.  
  10. for (int i=0;i<n;i++)
  11. {
  12. int pom;
  13. cin>>pom;
  14. if (pom%2==0)
  15. {
  16. cout<<pom;
  17. }
  18. else
  19. {
  20. cout<<pom*2;
  21. }
  22. cout<<" ";
  23. }
  24.  
  25. return 0;
  26. }
  27.  
Success #stdin #stdout 0.01s 5288KB
stdin
5
3 0 7 10 3
stdout
6 0 14 10 6