程序如下:
//Print header into summary data file
out2 << "Events\t\tLength\tTargets\tHits\tMisses\tUnforced Errors\tAverage Response Time" << endl;
if(counter%60 > 0){
out2.width(3);
out2.setf(ios::right);
out2 << counter - (counter%60) + 1;
out2<< "--";
out2<< counter<<"\t"<<"\t";
out2 << length << "\t" << targets << "\t" << hits << "\t" << misses << "\t";
out2 << endl;
}
结果如下:
<table>
<tr><td>Events</td> <td> length</td> <td>Targets </td> </tr>
<tr><td>XX1--60 </td> <td> 60</td><td>15</td> </tr>
<tr><td>X61--120</td><td>x</td><td>60</td> </tr>
<tr><td>121-- 180</td><td>60/td> </tr>
</table>
(XX代表空格)
问题:
为什么,从第二行开始,往后移了一格,所有的60都应当对齐的.
//Print header into summary data file
out2 << "Events\t\tLength\tTargets\tHits\tMisses\tUnforced Errors\tAverage Response Time" << endl;
if(counter%60 > 0){
out2.width(3);
out2.setf(ios::right);
out2 << counter - (counter%60) + 1;
out2<< "--";
out2<< counter<<"\t"<<"\t";
out2 << length << "\t" << targets << "\t" << hits << "\t" << misses << "\t";
out2 << endl;
}
结果如下:
<table>
<tr><td>Events</td> <td> length</td> <td>Targets </td> </tr>
<tr><td>XX1--60 </td> <td> 60</td><td>15</td> </tr>
<tr><td>X61--120</td><td>x</td><td>60</td> </tr>
<tr><td>121-- 180</td><td>60/td> </tr>
</table>
(XX代表空格)
问题:
为什么,从第二行开始,往后移了一格,所有的60都应当对齐的.