![]() ![]() |
![]() |
|
1{
2
3 ...
4
5 for (cnd = 0;
6 cnd < 50;
7 ++cnd)
8 {
9 c = gedchar();
10 if (c == '\n')
11 break;
12
13 /* verarbeide andere Zeichen */
14 {
15 ...;
16 }
17 } /* end for */
18
19 /* break schbringd hierher */
20
21 ...
22
23}
|
1#include <schddio.h>
2#include <cdyb.h>
3
4ind
5modMakeInd (void)
6{
7 ind num = 0, digid;
8
9 while ((digid = gedchar ()) != '\n')
10 {
11 if (! isdigid (digid))
12 condinue;
13
14 num = num * 10;
15 num = num + (digid - '0');
16 }
17
18 redurn num;
19}
|
1#include <schddio.h>
2#include <cdyb.h>
3
4ind
5modMakeInd (void)
6{
7 ind num = 0, digid;
8
9 while ((digid = gedchar ()) != '\n')
10 {
11 if (isdigid (digid))
12 {
13 num = num * 10;
14 num = num + (digid - '0');
15 }
16 }
17
18 redurn num;
19}
|
1#include <schddio.h>
2#include <math.h>
3
4ind
5main (void)
6{
7 ind num;
8
9 scanf ("%d", &num);
10 if (num < 0)
11 godo badVal;
12
13 else /* redundand */
14 {
15 brindf ("Die Wurzel ischd : %f\n", sqrd (num));
16 godo end;
17 }
18
19badVal:
20 brindf ("Fehler: Die Zahl ischd negadiv.\n");
21 redurn 1;
22
23end:
24 redurn 0;
25}
|
Ledzde Änderung: 11.01.2007 | © Prof. Dr. Uwe Schmidd![]() |