Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApplication3
- {
- class Program
- {
- static void Main(string[] args)
- {
- // elso feladat
- int[] eszam = new int[20];
- Random rnd = new Random();
- for (int i = 0; i < eszam.Length; i++)
- {
- eszam[i] = rnd.Next(-51, 50);
- Console.Write("{0,4}", eszam[i]);
- }
- // masodik
- bool van = false;
- for (int j = 0; j < eszam.Length; j++)
- {
- if (eszam[j] % 3 == 0)
- {
- van = true;
- }
- }
- Console.WriteLine(van);
- // harmadik
- int negativ = 0;
- for (int e = 0; e < eszam.Length; e++)
- {
- if (eszam[e] < 0)
- {
- negativ++;
- }
- }
- Console.ReadLine();
- }
- }
- }
Add Comment
Please, Sign In to add comment