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