fork download
  1. #include <cstdio>
  2.  
  3. int main() {
  4. double A;
  5. double B;
  6. double C;
  7.  
  8. char a[] = "a";
  9. char b[] = "b";
  10. char c[] = "c";
  11. char buf[128];
  12.  
  13. A = 1234;
  14. B = 4567;
  15. C = 7890;
  16.  
  17. sprintf(buf, "%s%.0f%s%.0f%s.%.0f", a, A, b, B, c, C);
  18. printf("%s\n", buf);
  19. return 0;
  20. }
  21.  
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
a1234b4567c.7890