Toggle navigation
Images.Elk.pl
Programowanie zjazd VIII 15 01 2011
#include
#include
using namespace std;
const char f = char(219);
const char e = ' ';
void drukuj(char k[5][5])
{
for (int i=0; i<5; i++)
{
for (int j=0; j<5; j++)
{
cout << k[i][j];
}
cout << endl;
}
}
int main()
{
char klocki[][4][5][5] =
{
{
{
{f,f,f,f,f},
{f,e,e,e,f},
{f,e,e,e,f},
{f,f,f,f,f},
{f,e,e,e,f}
},
{
{f,f,f,f,f},
{e,f,e,e,f},
{e,f,e,e,f},
{e,f,e,e,f},
{f,f,f,f,f}
},
{
{f,e,e,e,f},
{f,f,f,f,f},
{f,e,e,e,f},
{f,e,e,e,f},
{f,f,f,f,f}
},
{
{f,f,f,f,f},
{f,e,e,f,e},
{f,e,e,f,e},
{f,e,e,f,e},
{f,f,f,f,f}
}
}
};
drukuj(klocki[0][0]);
cout << endl;
drukuj(klocki[0][1]);
cout << endl;
drukuj(klocki[0][2]);
cout << endl;
drukuj(klocki[0][3]);
cout << endl;
}
#include
#include
using namespace std;
const char f = char(219);
const char e = ' ';
void drukuj(char k[5][5])
{
for (int i=0; i<5; i++)
{
for (int j=0; j<5; j++)
{
cout << k[i][j];
}
cout << endl;
}
}
int main()
{
char klocki[][4][5][5] =
{
{
{
{f,f,f,f,f},
{f,e,e,e,f},
{f,e,e,e,f},
{f,f,f,f,f},
{f,e,e,e,f}
},
{
{f,f,f,f,f},
{e,f,e,e,f},
{e,f,e,e,f},
{e,f,e,e,f},
{f,f,f,f,f}
},
{
{f,e,e,e,f},
{f,f,f,f,f},
{f,e,e,e,f},
{f,e,e,e,f},
{f,f,f,f,f}
},
{
{f,f,f,f,f},
{f,e,e,f,e},
{f,e,e,f,e},
{f,e,e,f,e},
{f,f,f,f,f}
}
}
};
int index = 0;
drukuj(klocki[0][index]);
cout << endl;
index = 7%4;
drukuj(klocki[0][index]);
cout << endl;
}
#include
#include
using namespace std;
const char f = char(219);
const char e = ' ';
void drukuj(char k[5][5])
{
for (int i=0; i<5; i++)
{
for (int j=0; j<5; j++)
{
cout << k[i][j];
}
cout << endl;
}
}
void wstaw(char plansza [][25], int r, int c, char k[][5])
{
for (int i=0; i<5; i++)
{
for (int j=0; j<5; j++)
{
plansza[r+i][c+j] = k[i][j];
}
cout << endl;
}
}
void drukujPlansza(char plansza[][25])
{
for (int i=0; i<5; i++)
{
for (int j=0; j<5; j++)
cout << plansza[i][j] == 0 ? ' ' : plansza[i][j];
cout << endl;
}
}
int main()
{
char klocki[][4][5][5] =
{
{
{
{f,f,f,f,f},
{f,e,e,e,f},
{f,e,e,e,f},
{f,f,f,f,f},
{f,e,e,e,f}
},
{
{f,f,f,f,f},
{e,f,e,e,f},
{e,f,e,e,f},
{e,f,e,e,f},
{f,f,f,f,f}
},
{
{f,e,e,e,f},
{f,f,f,f,f},
{f,e,e,e,f},
{f,e,e,e,f},
{f,f,f,f,f}
},
{
{f,f,f,f,f},
{f,e,e,f,e},
{f,e,e,f,e},
{f,e,e,f,e},
{f,f,f,f,f}
}
}
};
int index = 0;
drukuj(klocki[0][index]);
cout << endl;
index = 7%4;
drukuj(klocki[0][index]);
cout << endl;
char plansza[200][25] = {0};
wstaw(plansza,0,5,klocki[0][0]);
drukujPlansza(plansza);
}
#include
#include
using namespace std;
int main()
{
int a= 10;
int *r = &a;
int **y = &r;
cout << a << endl
<< &a << endl
<< r << endl
<< *r << endl
<< &r << endl
<< y << endl
<< *y << endl
<< **y << endl
<< &y << endl;
**y = 22;
cout << a << endl;
}
#include
#include
using namespace std;
void swap(float *a, float *b)
{
float temp=*a;
*a = *b;
*b = temp;
}
int main()
{
float x = 20, y =10;
swap(x,y);
cout << x << y << endl;
}
#include
#include
using namespace std;
void swap(float *a, float *b)
{
float temp=*a;
*a = *b;
*b = temp;
}
int main()
{
float x = 20, y =10;
int *t;
while (true)
{
t=new int;
}
//swap(x,y);
//cout << x << y << endl;
}
#include
#include
using namespace std;
void swap(float *a, float *b)
{
float *temp=a;
a = b;
b = temp;
}
int main(int argc, char* argv[]) //liczba argumentow, lancuch string
{
for (int i=0; i
{
cout << argv[i] << endl;
}
}
Wyszukiwarka
Podobne podstrony:
Programowanie sektora z komendami ENV 01 2011
Programowanie zjazd IX 29 01 2012
Programowanie cwiczenia zjazd VII 18 12 2011
Programowanie ćwiczenia zjazd IV 06 11 2011
komendy programowania 01 2011
22 01 2011 TEST B PSYCHOLOGIA S2id)467
MIKROEKONOMIA WYKŁAD 2 (15 10 2011) elastyczność popytu i podaży
Wykład z Ch Organicznej 15 01 2013
H Tendera W aszczuk, Integracja Europejska Wyk? VIII 19 04 2011
PKM egzamin 15 06 2011
500 złotych 15 01 1946
22 01 2011 TEST A 1id)464
więcej podobnych podstron