Advertisement
wingman007

IntroC#_exercise_1a

Sep 19th, 2014
334
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.61 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 ConsoleApplication9
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int a = 12;
  14.                
  15.             for (int i = 0; i<=12; i++)
  16.             {
  17.                 if (i % 2 == 1)
  18.                 {
  19.                     Console.WriteLine(i);
  20.                 }
  21.             }
  22.  
  23.             Console.WriteLine("molq vuvedete chislo");
  24.             int n = int.Parse(Console.ReadLine());
  25.  
  26.             printOdd(n);
  27.  
  28.             string[] names = {"Lili","Sonq","Pepi"};
  29.  
  30.             for (int j = 0; j < names.Length; j++ )
  31.             {
  32.                 Console.WriteLine(names[j]);
  33.             }
  34.  
  35.             printArray(names);
  36.             string[] input;
  37.             Console.WriteLine("Rasmer");
  38.             int size = int.Parse(Console.ReadLine());
  39.             input = new string[size];
  40.             for (int i = 0; i < input.Length; i++) {
  41.                 Console.WriteLine("vuvedete element {0}:", i);
  42.                 input[i] = Console.ReadLine();
  43.             }
  44.         }
  45.  
  46.  
  47.         static void printOdd(int n)
  48.         {        
  49.             for (int i = 0; i<=n; i++)
  50.             {
  51.                 if (i % 2 == 1)
  52.                 {
  53.                     Console.WriteLine(i);
  54.                 }
  55.             }
  56.         }
  57.  
  58.         static void printАrray(string[] names)
  59.         {
  60.             for (int j = 0; j < names.Length; j++ )
  61.             {
  62.                 Console.WriteLine(names[j]);
  63.             }
  64.         }
  65.  
  66.     }
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement