小妹最近剛在學C++,請大家幫我看看程式哪裡出問題了。
#include <cstdlib>
#include <iostream>
#include <iomanip>
using namespace std;
int main(int argc, char *argv[])
{
int y,z;
int i,j,a,b ;
cout<<"y = ";cin>>y;
cout<<"z = ";cin>>z;
for(i=1;i<=z;i+=3){
a=i+1;
b=i+2;
for(j=1;j<=y;j++){
cout<<i<<"*"<<j<<"="<<setw(2)<<i*j<<" ";
cout<<a<<"*"<<j<<"="<<setw(2)<<a*j<<" ";
cout<<b<<"*"<<j<<"="<<setw(2)<<b*j<<"\n";
}
cout<<"\n";
}
system("pause");
return EXIT_SUCCESS;
}
但跑出來的結果是
http://i.imgur.com/Rwlk8MY.jpg
但希望的結果是
http://i.imgur.com/2sSZHnp.jpg
謝謝大家!!