版本1和2间的区别
于2005-12-20 21:28:13修订的的版本1
大小: 1111
编辑: czk
备注:
于2005-12-20 21:30:50修订的的版本2
大小: 1294
编辑: czk
备注:
删除的内容标记成这样。 加入的内容标记成这样。
行号 2: 行号 2:
/*Exercise 1-1. Run the "hello, world" program on your system. Experiment with leaving out parts of the program, to see what error messages you get.*/ /*
Author: czk
Email: czkmail@163.com
Date: 20-12-05 21:30
Exercise 1-1. Run the "hello, world" program on your system. Experiment with leaving out parts of the program, to see what error messages you get.*/
行号 12: 行号 16:
/*Exercise 1-2. Experiment to find out what happens when prints's argument string contains \c, where c is some character not listed above.*/ /*
Author: czk
Email: czkmail@163.com
Date: 20-12-05 21:30
Exercise 1-2. Experiment to find out what happens when prints's argument string contains \c, where c is some character not listed above.*/
行号 22: 行号 30:
/*Exercise 1-3. Modify the temperature conversion program to print a heading above the table.*/ /*
Author: czk
Email: czkmail@163.com
Date: 20-12-05 21:30
Exercise 1-3. Modify the temperature conversion program to print a heading above the table.*/

   1 /*
   2 Author: czk
   3 Email: czkmail@163.com
   4 Date: 20-12-05 21:30
   5 Exercise 1-1. Run the "hello, world" program on your system. Experiment with leaving out parts of the program, to see what error messages you get.*/
   6 #include <stdio.h>
   7 
   8 main()
   9 {
  10     printf("hello, world\n");
  11 }

   1 /*
   2 Author: czk
   3 Email: czkmail@163.com
   4 Date: 20-12-05 21:30
   5 Exercise 1-2. Experiment to find out what happens when prints's argument string contains \c, where c is some character not listed above.*/
   6 #include <stdio.h>
   7 
   8 main()
   9 {
  10     printf("\a");
  11 }

   1 /*
   2 Author: czk
   3 Email: czkmail@163.com
   4 Date: 20-12-05 21:30
   5 Exercise 1-3. Modify the temperature conversion program to print a heading above the table.*/
   6 #include <stdio.h>
   7 
   8 /* print Fahrenheit-Celsius table
   9 for fahr = 0, 20, ..., 300; floating-point version */
  10 main()
  11 {
  12     float fahr, celsius;
  13     int lower, upper, step;
  14     
  15     lower = 0; /* lower limit of temperatuire scale */
  16     upper = 300; /* upper limit */
  17     step = 20; /* step size */
  18     
  19     printf("fahr celsius\n");
  20     
  21     fahr = lower;
  22     while (fahr <= upper) {
  23         celsius = (5.0/9.0) * (fahr-32.0);
  24         printf("%4.0f %7.1f\n", fahr, celsius);
  25         fahr = fahr + step;
  26     }
  27 }

Answer_to_Chapter_1 (2008-02-23 15:34:13由localhost编辑)

ch3n2k.com | Copyright (c) 2004-2020 czk.