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;
- namespace ConsoleApplication1
- {
- class Program
- {
- static void Main(string[] args)
- {
- int input, shum = 0, total = 0;
- for (int i = 0; i < 50; i++)
- {
- input = int.Parse(Console.ReadLine());
- input = input % 10;
- if (input % 3 == 0)
- {
- total++;
- }
- shum += input;
- }
- Console.WriteLine("All first digits together are: " + shum);
- Console.WriteLine("There are " + total + "numbers that can be devided with 3");
- Console.ReadLine();
- }
- }
- }
Add Comment
Please, Sign In to add comment