kk258966

4/30 C++ 練習一

Apr 30th, 2014
330
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. int main(void)
  4. {
  5.  int formula();
  6.  int c;
  7.  
  8.  for (c=10;c<=100;c=c+10)
  9.  {
  10.      formula(c);    
  11.  }
  12.  
  13.  
  14.     system("pause");
  15.     return 0;
  16. }
  17.  
  18.  
  19. int formula(int a)
  20. {
  21. float f;
  22. f=(float)(9.0*a)/5.0+32.0;
  23. printf("%d度C  |  %.2f度F\n",a,f);
  24. printf("---------------------------\n");    
  25. }
Advertisement
Add Comment
Please, Sign In to add comment