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;
- using System.Threading.Tasks;
- namespace SumaCyfr
- {
- class Program
- {
- static void Main(string[] args)
- {
- /* string str = Console.ReadLine();
- int a = int.Parse(str);
- for (int i = a - 1; i > 1; i--)
- {
- if (a % i == 0) { Console.WriteLine("Liczba podzielna przez: " + i); goto A; }
- }
- Console.WriteLine("Liczba pierwsza!");
- A:
- Console.ReadKey(); */
- string str = Console.ReadLine();
- int a = int.Parse(str);
- for (int i = a - 1; i > 1; i--)
- {
- if (a % i == 0) { Console.WriteLine("Liczba podzielna przez: " + i); break; }
- if (i == 2) Console.WriteLine("Liczba pierwsza!");
- }
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement