function trans(s, n){
//write code here
const arr = s.split(' ').map((item)=>{
let word = item.split('');
for(let i=0;i<word.length;i++){
if(word[i].charCodeAt(0)<word[i].toLowerCase().charCodeAt(0)){
word[i] = word[i].toLowerCase(); //大写转为小写
}else{
word[i] = word[i].toUpperCase();
}
}
return word.join('');
})
return arr.reverse().join(' ');
}
module.exports = {
trans : trans
}