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 Quersumme
- {
- class Program
- {
- static void Main(string[] args)
- {
- int intEingabe, intRestwert, intDivision, intQuersumme, intBerechnung;
- intDivision = 0;
- intRestwert = 0;
- Console.Write("\n\n\n\tGeben Sie eine Zahl ein: ");
- intEingabe = Convert.ToInt32(Console.ReadLine());
- intBerechnung = intEingabe;
- for (int i = -10; i < intRestwert; i++)
- {
- intRestwert = intBerechnung % 10;
- if (intEingabe > 0)
- {
- intDivision = intBerechnung / 10;
- }
- intBerechnung = intDivision;
- if (intRestwert <= 0)
- {
- intEingabe = 0;
- }
- Console.Write("\n\n\t{0}", intRestwert);
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment