Die Präsentation wird geladen. Bitte warten

Die Präsentation wird geladen. Bitte warten

Test - Beginn Die Verwendung von Unterlagen ist nicht zulässig. Entfernen Sie daher alle Unterlagen und sonstigen Utensilien. Tragen Sie Ihren Namen, Ihre.

Ähnliche Präsentationen


Präsentation zum Thema: "Test - Beginn Die Verwendung von Unterlagen ist nicht zulässig. Entfernen Sie daher alle Unterlagen und sonstigen Utensilien. Tragen Sie Ihren Namen, Ihre."—  Präsentation transkript:

1 Test - Beginn Die Verwendung von Unterlagen ist nicht zulässig. Entfernen Sie daher alle Unterlagen und sonstigen Utensilien. Tragen Sie Ihren Namen, Ihre Matrikelnummer, Reihe und Nummer Ihres Sitzplatzes sowie Ihre Praktikumsgruppe in das Testformular ein. Legen Sie Ihren Studentinnenausweis sichtbar neben Ihr Testformular und belassen Sie ihn während der gesamten Dauer des Tests dort. Notizen sind ausschließlich in den dafür vorgesehenen Bereichen des Testformulars vorzunehmen. (Nicht auf den Tisch schreiben!) Beim Testende SOFORT das Ausfüllen einstellen! Notizteil eventuell abtrennen und Testformular an die Person zu Ihrer Rechten weitergeben. Sollten Sie nach Testende beim Ausfüllen Ihres Testformulars angetroffen werden, ist Ihr Test ungültig!

2 Test 00 1 1:10 1:20 1:40 1:50 1:00 1:30 0:40 0:00 0:10 0:20 0:30 0:50 2:00 3:30 3:20 3:40 3:50 4:00 2:10 3:10 2:20 3:00 2:30 2:40 2:50 #include <iostream> using namespace std; void f(int m, int& n, int* k) { m = m+1; n = n+1; k = k+1; } int main() { int m=5; int n=7; int k=12; f(m, n, &k); cout << m << n << k; return 0; 6

3 Test 00 2 1:10 1:20 1:30 1:40 1:00 0:40 0:00 0:10 0:20 0:30 0:50 1:50 3:30 3:20 3:40 3:50 4:00 2:00 3:10 2:20 2:10 3:00 2:30 2:40 2:50 #include <iostream> using namespace std; void f(char* p1, char* p2) { p1 = p1 +1; char tmp = *p1; *p1 = *p2; *p2 = tmp; } int main() { char str[]="Ein Test"; f(str+1, str+3); f(str+5, str); cout << str; return 0; 1

4 Test 00 3 1:10 1:20 1:30 1:40 1:00 0:40 0:00 0:10 0:20 0:30 0:50 1:50 3:30 3:20 3:40 3:50 4:00 2:00 3:10 2:20 2:10 3:00 2:30 2:40 2:50 #include <iostream> using namespace std; char* f(char* str, int size) { size = size/2+1; char *buf = new char[size]; for (int i=0; i<size-1; i=i+1) buf[i]=str[i*2]; buf[size-1]=0; return buf; } int main() { char str[]="Ein Test"; char *pc = f(str, sizeof(str)); cout << pc << ":" << str; delete[] pc; return 0; 2

5 Test 00 4 1:10 1:20 1:30 1:40 1:00 0:40 0:00 0:10 0:20 0:30 0:50 1:50 3:30 3:20 3:40 3:50 4:00 2:00 3:10 2:20 2:10 3:00 2:30 2:40 2:50 #include <iostream> using namespace std; char* f(char* str) { return str+3; } int f(int k) { return k+3; double f(double d, int k) { return d+k+0.5; int main() { for (int i=0;i<4;i=i+1) switch (i) { case 0: cout<<f(i); break; case 1: cout<<f("abcdef"); break; case 2: cout<<f(0.5,2.5); break; case 3: cout<<f(1.5); break; case 4: cout<<f("danger"); break; return 0; 4

6 Test 00 5 1:10 1:20 1:30 1:40 1:00 0:40 0:00 0:10 0:20 0:30 0:50 1:50 3:30 3:20 3:40 3:50 4:00 2:00 3:10 2:20 2:10 3:00 2:30 2:40 2:50 #include <iostream> using namespace std; char* f(char *str="rstuv") { return str+3; } int f(int k) { return k+3; double f(double d, int k=10) { return d+k+0.5; int main() { cout<<f(1); cout<<f("abcdef"); cout<<f(0.5,2.5); cout<<f(1.5); cout<<f(); return 0; 5

7 Test 00 6 1:10 1:20 1:30 1:40 1:00 0:40 0:00 0:10 0:20 0:30 0:50 1:50 3:30 3:20 3:40 3:50 4:00 2:00 3:10 2:20 2:10 3:00 2:30 2:40 2:50 #include <iostream> using namespace std; void rek(char* p, int &r) { if (!*p) return; r=r+1; rek(p+2,r); cout<<*p; } int main() { int c=0; rek("abcdef",c); cout<<c; return 0; 5

8 Test 00 7 1:10 1:20 1:30 1:40 1:00 0:40 0:00 0:10 0:20 0:30 0:50 1:50 3:30 3:20 3:40 3:50 4:00 2:00 3:10 2:20 2:10 3:00 2:30 2:40 2:50 #include <iostream> using namespace std; void rek(int p, int &r) { if (p==3) return; cout<<p<<r; r=r+1; rek(p+1,r); } int main() { int a = 0; rek(0,a); return 0; 5

9 Test 00 8 1:10 1:20 1:30 1:40 1:00 0:40 0:00 0:10 0:20 0:30 0:50 1:50 3:30 3:20 3:40 3:50 4:00 2:00 3:10 2:20 2:10 3:00 2:30 2:40 2:50 #include <iostream> using namespace std; int f2() { try { cout<<"throw "; throw 3; cout<<"after throw "; } catch (int) { cout<<"c "; throw; void f1() { cout<<"call f2 "; f2(); cout<<"return from f2 "; catch (int k) { cout<<"b "<<k; int main() { cout<<"call f1 "; f1(); cout<<"return from f1 "; cout<<"a "; return 0; 5

10 Test 00 9 1:10 1:20 1:30 1:40 1:00 0:40 0:00 0:10 0:20 0:30 0:50 1:50 3:30 3:20 3:40 3:50 4:00 2:00 3:10 2:20 2:10 3:00 2:30 2:40 2:50 #include <iostream> using namespace std; void f(int arr[][2]) { for (int i=0;i<2;i=i+1) for (int j=0;j<2;j=j+1) arr[i][j]=arr[i][j]+i+j; } int main() { int arr[3][2][2]={0,1,2,3,4,5,6,7}; f(arr[0]); f(arr[2]); for (int i=0;i<3;i=i+1) for (int k=0;k<2;k=k+1) cout<<arr[i][j][k]; return 0; 5

11 Bitte nach RECHTS zum Rand weitergeben
Test - Ende Geben Sie Ihr Testformular unverzüglich ab, indem Sie es JETZT SOFORT (IN DIESEM MOMENT) zum rechten Rand Ihrer Sitzreihe weitergeben. Bitte nach RECHTS zum Rand weitergeben

12 1 5912 #include <iostream> using namespace std;
Test 00 1 #include <iostream> using namespace std; void f(int m, int& n, int* k) { m = m+1; n = n+1; k = k+1; } int main() { int m=5; int n=7; int k=12; f(m, n, &k); cout << m << n << k; return 0; 5912 1

13 2 si nTeEt #include <iostream> using namespace std;
Test 00 2 #include <iostream> using namespace std; void f(char* p1, char* p2) { p1 = p1 +1; char tmp = *p1; *p1 = *p2; *p2 = tmp; } int main() { char str[]="Ein Test"; f(str+1, str+3); f(str+5, str); cout << str; return 0; si nTeEt 2

14 3 EnTs:Ein Test Test 00 #include <iostream> using namespace std;
char* f(char* str, int size) { size = size/2+1; char *buf = new char[size]; for (int i=0; i<size-1; i=i+1) buf[i]=str[i*2]; buf[size-1]=0; return buf; } int main() { char str[]="Ein Test"; char *pc = f(str, sizeof(str)); cout << pc << ":" << str; delete[] pc; return 0; EnTs:Ein Test 3

15 4 3def34 Test 00 #include <iostream> using namespace std;
char* f(char* str) { return str+3; } int f(int k) { return k+3; double f(double d, int k) { return d+k+0.5; int main() { for (int i=0;i<4;i=i+1) switch (i) { case 0: cout<<f(i); break; case 1: cout<<f("abcdef"); break; case 2: cout<<f(0.5,2.5); break; case 3: cout<<f(1.5); break; case 4: cout<<f("danger"); break; return 0; 3def34 5

16 5 4def312uv Test 00 #include <iostream> using namespace std;
char* f(char *str="rstuv") { return str+3; } int f(int k) { return k+3; double f(double d, int k=10) { return d+k+0.5; int main() { cout<<f(1); cout<<f("abcdef"); cout<<f(0.5,2.5); cout<<f(1.5); cout<<f(); return 0; 4def312uv 5

17 6 eca3 #include <iostream> using namespace std;
Test 00 6 #include <iostream> using namespace std; void rek(char* p, int &r) { if (!*p) return; r=r+1; rek(p+2,r); cout<<*p; } int main() { int c=0; rek("abcdef",c); cout<<c; return 0; eca3 5

18 7 001122231303 #include <iostream> using namespace std;
Test 00 7 #include <iostream> using namespace std; void rek(int p, int &r) { if (p==3) return; cout<<p<<r; r=r+1; rek(p+1,r); } int main() { int a = 0; rek(0,a); return 0; 5

19 8 call f1 call f2 throw c b 3return from f1 Test 00 5
#include <iostream> using namespace std; int f2() { try { cout<<"throw "; throw 3; cout<<"after throw "; } catch (int) { cout<<"c "; throw; void f1() { cout<<"call f2 "; f2(); cout<<"return from f2 "; catch (int k) { cout<<"b "<<k; int main() { cout<<"call f1 "; f1(); cout<<"return from f1 "; cout<<"a "; return 0; call f1 call f2 throw c b 3return from f1 5

20 9 023545670112 #include <iostream> using namespace std;
Test 00 9 #include <iostream> using namespace std; void f(int arr[][2]) { for (int i=0;i<2;i=i+1) for (int j=0;j<2;j=j+1) arr[i][j]=arr[i][j]+i+j; } int main() { int arr[3][2][2]={0,1,2,3,4,5,6,7}; f(arr[0]); f(arr[2]); for (int i=0;i<3;i=i+1) for (int k=0;k<2;k=k+1) cout<<arr[i][j][k]; return 0; 5


Herunterladen ppt "Test - Beginn Die Verwendung von Unterlagen ist nicht zulässig. Entfernen Sie daher alle Unterlagen und sonstigen Utensilien. Tragen Sie Ihren Namen, Ihre."

Ähnliche Präsentationen


Google-Anzeigen