mirror of
https://github.com/DerTyp7/lf05-java.git
synced 2025-10-29 20:42:11 +01:00
Update Tonsignal.java
This commit is contained in:
@@ -19,21 +19,17 @@ public class Tonsignal {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
for(int c = 0; c < first.length; c++){
|
for(int c = 0; c < first.length; c++) {
|
||||||
if(c == 0){
|
if (c == 0) {
|
||||||
first[c] = (first[c+1] + first[c+2])/2;
|
first[c] = (first[c + 1] + first[c + 2]) / 2;
|
||||||
}else if(c == first.length-1){
|
} else if (c == first.length - 1) {
|
||||||
first[c] = (first[c-1] + first[c-2])/2;
|
first[c] = (first[c - 1] + first[c - 2]) / 2;
|
||||||
}else{
|
} else {
|
||||||
first[c] = (first[c-1] + first[c+1])/2;
|
first[c] = (first[c - 1] + first[c + 1]) / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
System.out.print(first[c] + " ");
|
System.out.print(first[c] + " ");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user