-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathzoom.cpp
86 lines (82 loc) · 3.25 KB
/
zoom.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#include<iostream>
using namespace std;
void zoom(){
int num,i,j,k;char arr[4];
cout <<"enter any number from 0,1,3,6,7,8,9 : ";
cin >> arr;
for (k=0;k<4;k++){num=arr[k];
switch (num){
case '0':{
for (i=0;i<5;i++){
for (j=0;j<5;j++){
if (i==0 || i==4){
cout<<"# ";}
else if (j==0){
cout<<"# ";}
else if(j==1||j==2||j==3){
cout<<" ";
}else if (j==4){
cout<<"# ";
}}cout<<endl<<endl;
}cout<<endl<<endl<<endl;break;}
case '1':{
for (i==0;i<5;i++){
for (j=0;j<5;j++){
if ((i==0 &&(j==0 ||j==1))||(i==1 &&j==0)||(i==2&&j==1)||(i==3&&(j==0||j==1))){
cout<<" ";
}else if ((i==4 || j==2)||(i==1 &&j==1)||(i==2 && j==0)){
cout<<"# ";
}
}cout<<endl<<endl;;
}cout<<endl<<endl<<endl;break;}
case '3':{
for (i==0;i<5;i++){
for (j=0;j<5;j++){
if (i==0||i==2||i==4||j==4){
cout<<"# ";
}else if ((i==1&&(j==0||j==1||j==2||j==3))||i==3&&(j==0||j==1||j==2||j==3)){
cout<<" ";
}
}cout<<endl<<endl;
}cout<<endl<<endl<<endl;break;}
case '5':{
for (i==0;i<5;i++){
for (j=0;j<5;j++){
if (i==0||i==2||i==4||(i==1 &&j==0)||(i==3 && j==4)){
cout<<"# ";
}else if ((i==1&&(j==0||j==1||j==2||j==3))||i==3&&(j==0||j==1||j==2||j==3)){
cout<<" ";
}
}cout<<endl<<endl;
}cout<<endl<<endl<<endl;break;}
case '6':{
for (i==0;i<5;i++){
for (j=0;j<5;j++){
if (j==0||i==2||i==4||(i==3&&j==4)){cout<<"# ";}
else if (i==3&&j!=4){cout<<" ";}
}cout<<endl<<endl;}cout<<endl<<endl<<endl;break;}
case '7':{
for (i==0;i<5;i++){
for (j=0;j<5;j++){
if (i==0||j==4){cout<<"# ";}
else if (i!=0&&j!=4){cout<<" ";break;}
}cout<<endl<<endl;}cout<<endl<<endl<<endl;}
case '8':{
for (i==0;i<5;i++){
for (j=0;j<5;j++){
if (i==0||i==2||i==4||j==0||(i==1&&j==4)||(i==3&&j==4)){cout<<"# ";}
else if ((i!=0||i!=2||i!=4||j!=4||j!=0)){cout<<" ";}
}cout<<endl<<endl;}cout<<endl<<endl<<endl;break;
}case '9':{
for (i==0;i<5;i++){
for (j=0;j<5;j++){
if (i==0||i==2||j==4||(i==1&&j==0)){
cout<<"# ";
}else if ((i!=0||i!=2)&&j!=4){cout<<" ";}
}cout<<endl<<endl;}cout<<endl<<endl<<endl;break;
}
}}}
int main(){
zoom();
return 0;
}