diff options
Diffstat (limited to 'Bachelor/Prog1/Prakt1/prg1pr1_4/prg1pr1_4.cpp')
| -rw-r--r-- | Bachelor/Prog1/Prakt1/prg1pr1_4/prg1pr1_4.cpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/Bachelor/Prog1/Prakt1/prg1pr1_4/prg1pr1_4.cpp b/Bachelor/Prog1/Prakt1/prg1pr1_4/prg1pr1_4.cpp new file mode 100644 index 0000000..8536977 --- /dev/null +++ b/Bachelor/Prog1/Prakt1/prg1pr1_4/prg1pr1_4.cpp @@ -0,0 +1,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;
+}
\ No newline at end of file |
