mirror of
https://github.com/DerTyp7/lf05-java.git
synced 2025-10-29 12:32:12 +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++){
|
||||
if(c == 0){
|
||||
first[c] = (first[c+1] + first[c+2])/2;
|
||||
}else if(c == first.length-1){
|
||||
first[c] = (first[c-1] + first[c-2])/2;
|
||||
}else{
|
||||
first[c] = (first[c-1] + first[c+1])/2;
|
||||
for(int c = 0; c < first.length; c++) {
|
||||
if (c == 0) {
|
||||
first[c] = (first[c + 1] + first[c + 2]) / 2;
|
||||
} else if (c == first.length - 1) {
|
||||
first[c] = (first[c - 1] + first[c - 2]) / 2;
|
||||
} else {
|
||||
first[c] = (first[c - 1] + first[c + 1]) / 2;
|
||||
}
|
||||
|
||||
|
||||
|
||||
System.out.print(first[c] + " ");
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user