Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
编写一个名为 replace3sWith4s() 的方法,该方法接受一个整数数组,并将任何值为 3 的元素更改为值为 4。
还需要包含一个 for 循环
void replace3sWith4s (int [] x) { for (int i = 0; i < x.length; i++) { if (x[i] == 3) { } } }
继承人我的代码此刻我还需要做什么?
使用java
很近....
if (x[i] == 3) { x[i] = 4; }