fork download
  1. #include <stdio.h>
  2. #define UPP 300
  3.  
  4. template<int n>
  5. void plusplus(float& x) {
  6. plusplus<n-1>(++x);
  7. }
  8.  
  9. template<>
  10. void plusplus<0>(float& x) {
  11. }
  12.  
  13.  
  14.  
  15. float conversion(float fahr);
  16.  
  17. main(){
  18. float far;
  19. for(far = 0; far <= UPP; plusplus<20>(far))
  20. printf("%.f\t%.1f\n", far, conversion(far));
  21. }
  22.  
  23. float conversion(float cels){
  24. float c;
  25. c = ((5*(cels-32))/(9));
  26. return c;
  27. }
  28.  
Success #stdin #stdout 0s 4296KB
stdin
Standard input is empty
stdout
0	-17.8
20	-6.7
40	4.4
60	15.6
80	26.7
100	37.8
120	48.9
140	60.0
160	71.1
180	82.2
200	93.3
220	104.4
240	115.6
260	126.7
280	137.8
300	148.9