範例:華氏  攝氏 #include /* print Fahrenheit-Celsius table for fahr = 0, 20,..., 300 */ main() { int fahr, celsius; for(fahr = 0; fahr

  • Published on
    13-Dec-2015

  • View
    215

  • Download
    2

Embed Size (px)

Transcript

  • Slide 1

#include /* print Fahrenheit-Celsius table for fahr = 0, 20,..., 300 */ main() { int fahr, celsius; for(fahr = 0; fahr #include main() { int number, numberRead; printf("Enter a nonnegative number:"); scanf("%d", & numberRead); number = numberRead; while (number % 5 == 0 && number > 0) number = number / 5; printf("Removing factor of 5 from %d, it becomes %d.\n", numberRead, number); } #includemain() { int number, numberRead; printf("Enter a nonnegative number:"); scanf("%d", & numberRead); number = numberRead; while (number % 5 == 0 && number > 0) number = number / 5; printf("Removing factor of 5 from %d, it becomes %d.\n", numberRead, number); } 5

Recommended

View more >