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;
- namespace ConsoleApplication11
- {
- class Program
- {
- static void Main(string[] args)
- {
- int a, b=0;
- Console.Write("Kérem a számot: ");
- a = int.Parse(Console.ReadLine());
- do{ //átfordítom (oszt tízzel, maradékot szoroz tízzel
- b = b * 10;
- int maradek = a % 10;
- a = a / 10;
- b = b + maradek;
- } while (a!=0);
- Console.WriteLine("A fordítottja: " + b);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement