MuffinMonster

Class Task 14#

Oct 23rd, 2013
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.75 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace ConsoleApplication1
  7. {
  8.     class Program
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.             int input, shum = 0, total = 0;
  13.             for (int i = 0; i < 50; i++)
  14.             {
  15.                 input = int.Parse(Console.ReadLine());
  16.                 input = input % 10;
  17.                 if (input % 3 == 0)
  18.                 {
  19.                     total++;
  20.                 }
  21.                 shum += input;
  22.             }
  23.             Console.WriteLine("All first digits together are: " + shum);
  24.             Console.WriteLine("There are " + total + "numbers that can be devided with 3");
  25.             Console.ReadLine();
  26.         }
  27.     }
  28. }
Add Comment
Please, Sign In to add comment