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 ZadatakSkola {
- class Program {
- static void Main(string[] args) {
- int start = Convert.ToInt32(Console.ReadLine());
- int end = 0;
- for (int i = start - 1; i > 0; i--) {
- if (start % i == 0) {
- end += i;
- }
- }
- if (start == end) {
- Console.WriteLine("Broj je savrsen " + end);
- } else {
- Console.WriteLine("Broj nije savrsen " + end);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement