fork download
  1. #include <stdio.h>
  2. #include <float.h>
  3.  
  4. int main(void) {
  5. // your code goes here
  6. double pai=3.14159265358979;
  7. int mon=2;
  8. float flt=1.2f;
  9.  
  10. printf("%5.2f\n",flt);
  11. printf("%-5.2f\n",flt);
  12. printf("%05.2f\n",flt);
  13. printf("%+08.2f\n",flt);
  14. printf("%-08.2f\n",flt);
  15.  
  16. printf("%d\n",mon=3);
  17. printf("%e\n",pai);
  18.  
  19. printf("%08.2f\n",pai);
  20. printf("%05d\n",mon);
  21.  
  22. printf("ratio of the circumference of a circle to its diameter is %f\n",pai);
  23. printf("ratio of the circumference of a circle to its diameter is %010.2f\n",pai);
  24. printf("ratio of the circumference of a circle to its diameter is %f-10.2f\n",pai);
  25. printf("ratio of the circumference of a circle to its diameter is %f10.2f\n",pai);
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32. return 0;
  33. }
  34.  
Success #stdin #stdout 0s 5324KB
stdin
Standard input is empty
stdout
 1.20
1.20 
01.20
+0001.20
1.20    
3
3.141593e+00
00003.14
00003
ratio of the circumference of a circle to its diameter is 3.141593
ratio of the circumference of a circle to its diameter is 0000003.14
ratio of the circumference of a circle to its diameter is 3.141593-10.2f
ratio of the circumference of a circle to its diameter is 3.14159310.2f