blob: 16376271e12ee90dd546219c9477760cda7c3e93 (
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
41
42
43
44
45
46
47
48
|
int col;
int row;
int getChar( )
{
int c;
c = getchar( );
if( c == EOF ) {
return c;
}
col++;
if( c == '\n' ) {
col = 1;
row++;
}
return c;
}
int main( int argc, char **argv )
{
int c;
col = 1;
row = 1;
putstring( "Hello CC" );
putnl( );
c = getChar( );
putint( row );
putstring( ": " );
while( c != EOF ) {
if( c == '\n' ) {
putchar( '$' );
putchar( c );
putint( row );
putstring( ": " );
} else {
putchar( c );
}
c = getChar( );
}
exit( EXIT_SUCCESS );
return EXIT_SUCCESS;
}
|