Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function main() {
- var t = parseInt(readLine());
- for(var a0 = 0; a0 < t; a0++){
- var n = parseInt(readLine()); // hier überschreibst du immer den gleichen wert
- }
- // wenn du die Werte in einen Array schreiben willst, musst du sowas machen
- var tests = [];
- for(var i = 0; i < t; i++){
- tests.push(parseInt(readLine()));
- }
- var cycles = t.split('\n'); // ich weiß nicht genau, was du hier machen wills, aber t ist eine Zahle
- var numberOfCycles = cycles[0]; // numberOfCycles steht in t
- cycles.shift();
- var heigthArr = [];
- for (i=0; i<numberOfCycles; i++){
- var currheight = 1;
- for(m =cycles[i]; m>=0; m--){
- if(m!=0){
- if(m %2 == 0){
- currheight = currheight*2;
- } else {
- currheight = currheight +1;
- }
- }
- heigthArr.push(currheight);
- }
- }
- for(u=0; u<heigthArr.length -1; u++ ){
- console.log(heigthArr[u] + '\n');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement