Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #define N 4
- using namespace std;
- void Zapis(int a[N][N]){
- int count=0;
- for(int i=0; i<N; i++){
- for(int j=0; j<N; j++){
- a[i][j]=count;
- count++;
- }
- }
- }
- void ViVod(int a[N][N], int x, int y){
- for(int i=0; i<N; i++){
- for(int j=0; j<N; j++){
- if(a[i][j]<10){
- if(i==x && j==y){
- cout << " (" << a[i][j] << ")";
- }else
- cout << " " << a[i][j] << " ";
- }
- if(a[i][j]>=10){
- if(i==x && j==y){
- cout << "(" << a[i][j] << ")";
- }else
- cout << " " << a[i][j] << " ";
- }
- }
- cout << endl;
- }
- }
- int main(){
- int a[N][N], x=3, y=3;
- bool True=1;
- char vvod;
- Zapis(a);
- while(True){
- ViVod(a,x,y);
- cin << vvod;
- True=0;
- }
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement