返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. #include<string>
  4. using namespace std;
  5. void compute(int p[]){
  6.     for(int i=1; i<=p[0]; i++){
  7.         for(int j=1; j<=p[1]; j++){
  8.             cout<<"*";
  9.         }
  10.         cout<<endl;
  11.     }
  12. }
  13. int main(){
  14.     int p[1];
  15.     cin>>p[0]>>p[1];
  16.     compute(p);
  17.     cout<<p[0]*p[1];
  18. }
複製代碼

TOP

返回列表