Advertisement
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;
- namespace primek
- {
- class Program
- {
- static void Main(string[] args)
- {
- string a;
- int b, i=1, c=0;
- int elemszam = 10;
- int[] tomb = new int[elemszam];
- Console.Write("Szám: ");
- a = Console.ReadLine();
- b = Convert.ToInt32(a);
- do
- {
- if(i % b == 0)
- {
- tomb[c] = i;
- c++;
- }
- i++;
- }while(c < elemszam);
- for(int j = 0; j < elemszam; j++)
- {
- Console.Write(tomb[j]);
- if (j + 1 != elemszam)
- {
- Console.Write(", ");
- }
- else
- {
- Console.WriteLine();
- }
- }
- Console.WriteLine(tomb.Length);
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement