Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace rabota2
- {
- class MainClass
- {
- public static void Main (string[] args)
- {
- int n = int.Parse (Console.ReadLine ());
- bool found = false;
- for (int i = 2; i < n; i++) {
- if (n % i == 0) {
- found = true;
- break;
- }
- }
- if (found) {
- Console.WriteLine ("Число не является простым");
- } else {
- Console.WriteLine ("Число является простым");
- }
- Console.ReadKey ();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment