3 תשובות
שואל השאלה:
אני לא יודעת מאיפה להתחיל
אנונימית
תתחילי מלכתוב את 20 המשתנים
תכתבי קליטה של כל אחת שזה writeline להקלטה ואז priteline להפדסה.
אנונימי
// create an array to store the heights
int[] heights = new int[20];

// loop through the reference points to capture the heights
for (int i = 0; i < 20; i++)
{
heights[i] = getheight();
}

// create a new array to store the peak heights
int[] peakheights = new int[20];

// loop through the heights array to add a number from each sequence to the peakheights array
int index = 0;
foreach (int height in heights)
{
peakheights[index] = height;
index++;
}

// print the completed peakheights array
foreach (int peakheight in peakheights)
{
console.writeline(peakheight);
}