像我这样写求一个整型变量的位数,为什么编译通不过
#include <bits/stdc++.h> using namespace std; int main() { int d; cin>>d; string a=("%d",d); cout<<a.length(); }
有谁能帮我解释一下
按说这样像printf一样写,编译应该是可以通过的