fork download
  1. #include <iostream>
  2. using namespace std;
  3. int main(){
  4. int m,n;
  5. cin>>n>>m;
  6. for(int i=1;i<m+1;i++){
  7. for(int j=1;j<n+1;j++){
  8. if(i%2==0){
  9. if ((j+3)%4==0)
  10. cout<< "1";
  11. else
  12. cout<<(j%4==0?"2":"+");
  13. }
  14. else{
  15. if ((j+1)%4==0)
  16. cout<<"1";
  17. else
  18. cout<<((j+2)%4==0?"2":"+");
  19. }
  20. }
  21. cout<<endl;
  22. }
  23. return 0;
  24. }
Success #stdin #stdout 0s 3416KB
stdin
25 8
stdout
+21++21++21++21++21++21++
1++21++21++21++21++21++21
+21++21++21++21++21++21++
1++21++21++21++21++21++21
+21++21++21++21++21++21++
1++21++21++21++21++21++21
+21++21++21++21++21++21++
1++21++21++21++21++21++21