a53

Wildfire1_Of

a53
Jan 18th, 2019
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. int n,m,x,y;
  7.  
  8. int main(){
  9. cin>>x>>y>>n>>m;
  10. for(int i=1;i<=n;i++){
  11. for(int j=1;j<=m;j++){
  12. cout<<1+abs(x-i)+abs(y-j)<<' ';
  13. }
  14. cout<<'\n';
  15. }
  16. return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment