33,317
社区成员
发帖
与我相关
我的任务
分享#include <iostream>
using namespace std;
int main(){
for(int i = 1; i <= 9; i++){
for(int j = 1; j <= i; j++){
cout << j << "x" << i << "=" << j * i << ", " ;
if((j == 2) && (i == 3 || i == 4)){
cout << " ";
}
}
cout << "\b\b." << endl;
}
}#include <iostream>
using namespace std;
int main(){
int right = 0;
while(right < 9){
right++;
for(int left = 1; left <= right; left++){
cout << left << "x" << right << "=" << left * right << " ";
if((left == 2) && ((right == 3) || (right == 4))){
cout << " ";
}
}
cout << endl;
}
}#include <iostream>
using namespace std;
int main(){
int right = 0;
do{
right++;
for(int left = 1; left <= right; left++){
cout << left << "x" << right << "=" << left * right << " ";
if((left == 2) && ((right == 3) || (right == 4))){
cout << " ";
}
}
cout << endl;
}while(right < 9);
}