Advertisement
Guest User

Untitled

a guest
Jan 30th, 2015
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1.  
  2.  
  3. #include <fstream>
  4. #include <iostream>
  5. using namespace std;
  6.  
  7.  
  8. int main()
  9. {
  10. int n,m;
  11. cin>>n>>m;
  12. int a[n][m];
  13. for(int i=0,j=0;i!=n && j!=m;i++){
  14. int set=0;
  15. if(i==set){
  16. a[i][j]=0;
  17. set++;
  18. }else if(i>set){
  19. a[i][j]=2;
  20. }else if(i<set){
  21. a[i][j]=1;
  22. }
  23. if(i==n){
  24. i=0;
  25. j++;
  26. }
  27. }
  28. int i=0,j=0;
  29. for(i=0;i!=n;i++)
  30. cout<<a[i][j]<<" ";
  31. for(j=0; j!=m;j++){
  32. cout<<a[i][j]<<" ";
  33. }
  34. return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement