#769 Ordcol.pdf

  • Uploaded by: Algoritm89
  • 0
  • 0
  • May 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View #769 Ordcol.pdf as PDF for free.

More details

  • Words: 57
  • Pages: 1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26

#include using namespace std; int main() { int n,m,i,j,matrik[1000][101],aux,ok; cin>>n>>m; for(i=1;i<=n;i++) for(j=1;j<=m;j++) cin>>matrik[i][j]; do{ok=1; for(j=1;j<m;j++) if(matrik[1][j]>matrik[1][j+1]) { for(i=1;i<=n;i++){ aux=matrik[i][j+1]; matrik[i][j+1]=matrik[i][j]; matrik[i][j]=aux;} ok=0; } }while(!ok); for(i=1;i<=n;i++){ for(j=1;j<=m;j++) cout<<matrik[i][j]<<" "; cout<<endl; } }

Related Documents


More Documents from "Felipe Hidalgo"

May 2020 5
#769 Ordcol.pdf
May 2020 24