Advertisement
Guest User

Untitled

a guest
Feb 26th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApplication58
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int[] b = new int[10];
  14.  
  15. int count = 0;
  16. int[] a = new int[10];
  17. for(int i = 0; i < a.Length; i++)
  18. {
  19. Console.WriteLine("A is : ");
  20. a[i] = int.Parse(Console.ReadLine());
  21.  
  22. if (a[i] < 0)
  23. {
  24.  
  25. count++;
  26. b[i] = a[i];
  27. }
  28. Console.WriteLine( " " );
  29.  
  30.  
  31. }
  32. for (int i = count + 1; i < a.Length ; i++)
  33. {
  34. if (a[i] > 0)
  35. b[i] = a[i];
  36.  
  37.  
  38. }
  39. for(int i = 0 ; i < b.Length; i++)
  40.  
  41. {
  42. Console.Write(" B is : " + b[i]);
  43. }
  44.  
  45. }
  46. }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement