In the area of 10 districts. The areas sown with wheat (in hectares) and the average yield (in centners of a hectare. In each district) are determined. Determine the amount of wheat collected in the region and the average yield in the region.
|
1 answer
Get to know Google, but in general something like this:
static void Main(string[] args) { int[] a = new int[10]; int[] b = new int[10]; int oblPl = 0, oblU = 0; for (int i = 1; i < 10; i++) { Console.WriteLine("Ukazhite ploshad' " + i); a[i] = int.Parse(Console.ReadLine()); Console.WriteLine("Ukazhite urozhai " + i); b[i] = int.Parse(Console.ReadLine()); oblU = oblU + a[i] * b[i]; oblPl = oblPl + a[i]; } Console.WriteLine("Oblastnaya ploshad' " + oblPl); Console.WriteLine("Oblastnaya urozhainost' " + oblU/oblPl); Console.ReadLine(); } - oneneed average yield, not gross yield. oblU divide by 10 - renegator
- Oh, exactly missed. Thank! More precisely, not even 10, and the entire area. - invincible
|