#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
int n;
char wybor;
cout<<"Podaj liczbe n: ";
cin>>n;
cout<<"Wybierz sposob oblizenia za pomoca skrotu(m-mnozenie/d-dzielenie): ";
cin>>wybor;
switch(wybor){
case 'm':
if(n>0){
for(int i=1;i<=n;i++){
for(int j=1;j<=n;j++){
cout<<i*j<<" |";
}
}
cout<<" "<<endl;
}
else{
for(int i=1;i>=n;i--){
for(int j=-1;j>=n;j--){
cout<<i*j<<" |";
}
}
cout<<" "<<endl;
}
case 'd':
if(n>0){
for(int i=1;i<=n;i++){
for(int j=1;j<=n;j++){
cout<<i/j<<" | ";
}
}
cout<<endl;
}
else{
for(int i=1;i>=n;i--){
for(int j=-1;j>=n;j--){
cout<<i/j<<" | ";
}
}
cout<<endl;
}
break;
default:
cout << "Niepoprawny wybor. Wybierz 'm' lub 'd'." << endl;
}
return 0;
}