lab9
This commit is contained in:
@@ -0,0 +1,78 @@
|
||||
#include "func.h"
|
||||
|
||||
void seeMassive(wchar_t (*massive)[COL]){
|
||||
printf("\t\t\tMassive\n\n[ ] ");
|
||||
for(int i = 0;i<COL;i++)
|
||||
printf("[%d] ",i);
|
||||
putchar('\n');putchar('\n');
|
||||
|
||||
for(int i = 0;i<ROW;i++){
|
||||
printf("[%d] ",i);
|
||||
for(int j = 0;j<COL;j++){
|
||||
printf("[%lc] ",*(*(massive+i)+j));
|
||||
}
|
||||
putchar('\n');putchar('\n');
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
void setMassive(int x, wchar_t (*massive)[COL]){
|
||||
int b,c,o,e,cell=0;
|
||||
wchar_t buff[5];
|
||||
switch(x){
|
||||
case 21:
|
||||
for(int col = 0;col<COL;col++){
|
||||
for(int row = 0;row<ROW;row++){
|
||||
o = *(*(massive+col)+row);
|
||||
*(*(massive+col)+row) = 'X';
|
||||
seeMassive(massive);
|
||||
printf("Massive Input: ");
|
||||
|
||||
e=getsymb(&b,buff);
|
||||
if(e==-1)c=' ';
|
||||
|
||||
if(e==1){
|
||||
for(int i = 1;i<4;i++)
|
||||
cell = (cell*10)+(buff[i]-'0');
|
||||
if(cell>ROW*COL-1)
|
||||
printf("Error cell cannot be bigger %d",ROW*COL-1);
|
||||
else while(cell>0){
|
||||
col = row = 0;
|
||||
if(col<COL)col++;
|
||||
else {row++;col=0;}
|
||||
}
|
||||
}
|
||||
|
||||
if(e==0){
|
||||
for(int i = 0;i<b;i++){
|
||||
if(col<COL){
|
||||
printf("Z");
|
||||
*(*(massive+col)+row)=buff[i];
|
||||
col++;
|
||||
}
|
||||
else if(row<ROW){
|
||||
col=0;
|
||||
row++;
|
||||
*(*(massive+col)+row)=buff[i];
|
||||
}
|
||||
else c = ' ';
|
||||
}
|
||||
}
|
||||
|
||||
if(c==' '){*(*(massive+col)+row) = o;break;}
|
||||
}
|
||||
if(c==' ')break;
|
||||
}
|
||||
helpMenu();
|
||||
break;
|
||||
default:printf("Eror setmassive-%d\n",x);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void func(int x, wchar_t (*massive)[COL]){
|
||||
switch(x){
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user