我的代碼是:與C格式「%3d」等效的C++是什麼?
#include<iostream>
using namespace std;
int main()
{
int count=0;
int total=0;
while(count<=10)
{
total=total+count;
cout<<"count"<<"="<<count/*<<','*/<<'\t'<<'\t'<<"total"<<"="<<total<<endl;
count++;
}
}
你想做什麼?你期望的輸出是什麼? –
使用I/O操縱器(例如['setw()'](http://en.cppreference.com/w/cpp/io/manip))。 –
當計數= 9總= 45 – shazi