אדם לאדם זאב: הבדלים בין גרסאות בדף
תוכן שנמחק תוכן שנוסף
restore oldid=288421 RimerMoshe |
אין תקציר עריכה |
||
שורה 1:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace sela.hashamen
{
class Q3
{
static void Main(string[] args)
{
int[,] arr = new int[3, 3];
for (int i = 0; i < arr.GetLength(0); i++)
{
for (int j = 0; j < arr.GetLength(1); j++)
{
arr[i, j] = int.Parse(Console.ReadLine());
}
}
}
public static bool sela.may(int[,] a,int num)
{
int[] arr = new int[num];
for (int i = 0; i < a.GetLength(0); i++)
{
for (int j = 0; j < a.GetLength(0); j++)
{
if (a[i, j] != 0)
arr[i]++;
}
}
for (int k = 0; k < arr.Length; k++)
{
if (arr[k] > 2)
return false;
}
int x = 0;
for (int q = 0; q < arr.Length; q++)
{
x += arr[q];
}
if (x * 0.2 <= a.GetLength(0) * a.GetLength(1))
return true;
else
return false;
}
}
}
|