summaryrefslogtreecommitdiffstats
path: root/Bachelor/Prog1/Prakt1/prg1pr1_4/prg1pr1_4.cpp
blob: 85369775a8229fc9360a1958286153627b4cf83e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Programmieren 1, Praktikum 1, Aufgabe 4
// Sven Eisenhauer
// 27.10.2004

#include <iostream>
//#include <math.h>

using std::cout;
using std::cin;
using std::endl;

int main ()
{
	// const iDigits=6;          // number of digits entered
    int iZahl;                // user input
	// int iCounter=iDigits-1;   // use digits from iDigits-1 to 0 of iZahl

	// cout << "Bitte eine "<<iDigits<<"-stellige ganze Zahl eingeben: ";
    cout << "Bitte eine fuenfstellige ganze Zahl eingeben: ";
	cin >> iZahl;

	/* for (iCounter;iCounter>=0;iCounter--)
	{
       cout << static_cast <int> (iZahl / pow(10,iCounter)) << "\n";
	   iZahl=iZahl%static_cast <int> (pow(10,iCounter));
	}
    */

    cout << iZahl/10000 << endl;
    iZahl=iZahl%10000;
    cout << iZahl/1000 << endl;
    iZahl=iZahl%1000;
    cout << iZahl/100 << endl;
    iZahl=iZahl%100;
    cout << iZahl/10 << endl;
    iZahl=iZahl%10;
    cout << iZahl << endl;

	return 0;
}