Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- const int N=3;
- int f, p, i, j, q, a[N][N], w, k, b[1][N];
- for(w=0; w<N; w++){
- for(k=0; k<N; k++){
- a[w][k]=1;
- }}
- for(w=0; w<N; w++){
- for(k=0; k<N; k++){
- cout<<a[w][k]<<'\t';
- }
- cout<<endl;
- }
- cout<<"wprowadz p"<<endl;
- cin>>p;
- for(f=0; f<p; f++){
- do{ cout<<"wprowadz i"<<endl;
- cin>>i;}
- while(i<0||i>N-1);
- do{ cout<<"wprowadz j"<<endl;
- cin>>j;}
- while(j<0||j>N-1);
- cout<<"wprowadz q"<<endl;
- cin>>q;
- for(w=0; w<N; w++){
- for(k=0; k<N; k++){
- if(w==i&&k==j)a[w][k]=q;
- }
- }
- }
- for(w=0; w<N; w++){
- for(k=0; k<N; k++){
- cout<<a[w][k]<<'\t';
- }
- cout<<endl;
- }
- if((a[0][0]<0&&a[N-1][N-1]<0)||(a[0][0]>0&&a[N-1][N-1]>0)){
- for()
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement