Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- using namespace std;
- /* run this program using the console pauser or add your own getch, system("pause") or input loop*/
- class Macierz{
- int wektor[100];
- int macierz[5][5];
- public:
- Macierz(){
- for(int a=0;a<100;a++)
- wektor[a]=a+1;
- for(int z=0;z<5;z++)
- {for(int x=0;x<5;x++)
- macierz[z][x]=1;
- }
- }
- void wypiszw(){
- for(int a=0;a<100;a++)
- cout<<wektor[a]<<" ";}
- void wypiszm(){
- for(int z=0;z<5;z++)
- {cout<<endl;
- for(int x=0;x<5;x++)
- cout<<macierz[z][x]<<" ";}
- }
- void zmiana(int i, int j, int k){
- cout<<endl<<"Podaj wiersz i kolumne"<<endl;
- cin>>i>>j;
- cout<<endl<<"Na jaka liczbe chcesz zmienic?"<<endl;
- cin>>k;
- macierz[i][j]=k;
- }
- };
- int main(int argc, char** argv) {
- Macierz q;
- q.wypiszw();
- q.wypiszm();
- q.zmiana(1,1,5);
- q.wypiszm();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement