Advertisement
Guest User

Untitled

a guest
Sep 19th, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. using namespace std;
  4. int main(){
  5.  
  6. float x[4][3];
  7. int i, j, N, M;
  8.  
  9. cout<<"upisite dimenzije niza: "<<endl;
  10. cout<<endl;
  11.  
  12. do{
  13. cout<<"broj redova= "; cin>>N;
  14. cout<<"broj kolona= "; cin>>M;
  15. } while((N>4)||(M>3));
  16. cout<<endl;
  17.  
  18. for(i=0; i<N; i++){
  19. cout<<"unesite elemente niza"<<endl;
  20. for(j=0; j<M; j++){
  21. cout<<"x["<<i<<","<<j<<"]=";
  22. cin>>x[i][j];
  23. }
  24. }
  25. cout<<"niz je ucitan"<<endl;
  26.  
  27. cout<<endl;
  28. cout<<"upisali ste niz: "<<endl;
  29. cout<<endl;
  30.  
  31. for(i=0; i<N; i++){
  32. for(j=0; j<M; j++){
  33. cout<<setw(6)<<x[i][j];
  34. }
  35. cout<<endl;
  36. }
  37.  
  38. return 0;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement