How to print a number of type std::ptrdiff_t with std::printf on Codeforces?

Revision en1, by xyf007, 2021-04-25 03:38:06

I searched printf on Wikipedia, and it says I should use std::printf("%td", x);. However it doesn't work on Codeforces. When I used it, it only printed two English characters t and d. See this submission 114157818. Also I wish to know how to print a std::size_t number. std::printf("%zu") doesn't work, either. Does it mean I have to cast it to int or use std::cout?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English xyf007 2021-04-25 03:38:06 537 Initial revision (published)