08_while.c 255 B

12345678910111213141516171819202122232425
  1. #include <stdio.h>
  2. int main()
  3. {
  4. int a;
  5. int p;
  6. int t;
  7. a = 1;
  8. p = 0;
  9. t = 0;
  10. while (a < 100)
  11. {
  12. printf("%d\n", a);
  13. t = a;
  14. a = t + p;
  15. p = t;
  16. }
  17. return 0;
  18. }
  19. // vim: set expandtab ts=4 sw=3 sts=3 tw=80 :