From 33613a85afc4b1481367fbe92a17ee59c240250b Mon Sep 17 00:00:00 2001 From: Sven Eisenhauer Date: Fri, 10 Nov 2023 15:11:48 +0100 Subject: add new repo --- Bachelor/Prog1/Prakt1/prg1pr1_4/prg1pr1_4.cpp | 40 +++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 Bachelor/Prog1/Prakt1/prg1pr1_4/prg1pr1_4.cpp (limited to 'Bachelor/Prog1/Prakt1/prg1pr1_4/prg1pr1_4.cpp') 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 +//#include + +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 "<> iZahl; + + /* for (iCounter;iCounter>=0;iCounter--) + { + cout << static_cast (iZahl / pow(10,iCounter)) << "\n"; + iZahl=iZahl%static_cast (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 -- cgit v1.2.3