TizzyT

Multiple3n5 -TizzyT

Feb 10th, 2016
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.49 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Multiple3n5
  4. {
  5.     internal class Program
  6.     {
  7.         private static void Main(string[] args)
  8.         {
  9.             bool[] Nbrs = new bool[1000];
  10.             int R = 0;
  11.             for (int i = 3; i < 1000; i += 3)
  12.             {
  13.                 Nbrs[i] = true;
  14.                 R += i;
  15.             }
  16.             for (int i = 5; i < 1000; i += 5) if (!(Nbrs[i])) R += i;
  17.             Console.WriteLine(R);
  18.             Console.ReadKey();
  19.         }
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment