File tree Expand file tree Collapse file tree 1 file changed +76
-0
lines changed Expand file tree Collapse file tree 1 file changed +76
-0
lines changed Original file line number Diff line number Diff line change 1+ #include < iostream>
2+
3+ using namespace std ;
4+
5+ int main () {
6+ /*
7+
8+
9+ for(int i = 0; i < 10; i++) { // z uzyciem petli for od 0
10+ for(int j = 0; j<10; j++) {
11+ cout<<(i+1)*(j+1)<<"\t";
12+ }
13+ cout<<endl;
14+ }
15+
16+ cout<<"\n";
17+
18+ for(int i = 1; i <= 10; i++) { // z uzyciem petli for od 1
19+ for(int j = 1; j <=10; j++) {
20+ cout<<i*j<<"\t";
21+ }
22+ cout<<"\n";
23+ }
24+
25+
26+ */
27+
28+ int x = 5 ;
29+ int y = 6 ;
30+
31+ cout<<" \n x = " <<x<<" \n " <<" y = " <<y<<" \n\n " ;
32+
33+ for (int i = 0 ; i <= y; i++) { // kwadrat pe³ny
34+ for (int j = 0 ; j<= x; j++) {
35+ cout<<" X " ;
36+ }
37+ cout<<" \n " ;
38+ }
39+
40+ cout<<" \n x = " <<x<<" \n " <<" y = " <<y<<" \n\n " ;
41+
42+ for (int i = 0 ; i <= y; i++) { // tylko wierzcholki
43+ if (i == 0 || i == y) {
44+
45+ for (int j = 0 ; j<= x; j++) {
46+ if (j == 0 || j == x) {
47+
48+ cout<<" X " ;
49+ } else {
50+ cout<<" " ;
51+ }
52+ }
53+ }
54+ cout<<" \n " ;
55+ }
56+
57+ cout<<" \n x = " <<x<<" \n " <<" y = " <<y<<" \n\n " ;
58+
59+
60+ for (int i = 0 ; i <= y; i++) { // tylko wierzcholki
61+ for (int j = 0 ; j<= x; j++) {
62+
63+
64+ if (i==0 || i == y) {
65+ cout<<" X " ;
66+ } else if (j == 0 || j == x) {
67+ cout<<" X " ;
68+ } else {
69+ cout<<" " ;
70+ }
71+ }
72+ cout<<" \n " ;
73+ }
74+
75+ return 0 ;
76+ }
You can’t perform that action at this time.
0 commit comments