Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2014
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.71 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApplication2
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             Console.WriteLine("rok podaj");
  14.             int year = int.Parse(Console.ReadLine());
  15.             int pierwsza = year / 1000;
  16.             int druga = (year - (pierwsza * 1000)) / 100;
  17.             int trzecia = (year - (pierwsza * 1000 + druga * 100) )/10;
  18.             int czwarta = year - (pierwsza * 1000 + druga * 100 + trzecia * 10);
  19.             Console.WriteLine("podales "+pierwsza+""+druga+""+trzecia+""+czwarta);
  20.             Console.ReadKey();
  21.  
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement