Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- public class Program
- {
- public static void Main()
- {
- int db = 10;
- int [] T = new int[db];
- Random vszam = new Random();
- for(int i=0; i<db; i++){
- T[i]=vszam.Next(-10,10);
- Console.Write(T[i]);
- if(i<db-1) Console.Write(" ");
- }
- int elofordul=0;
- for(int i=0; i<db-1; i++) {
- if(T[i]>0 && T[i+1]<0) elofordul++;
- }
- Console.WriteLine("\n"+elofordul);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment