Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #ifndef N
- #define N 5
- #endif
- void wypisz_wiersz_spacji() {
- for(int i = 0; i < N + 1; ++i) {
- printf(" ");
- }
- }
- void wypisz_wiersz_sciany_z_przejsciem(int wiersz, int tablica[6][N][N]) {
- for(int kolumna = 0; kolumna < N; ++kolumna){
- printf("%d\n", tablica[0][wiersz][kolumna]);
- }
- }
- void up(int tablica[6][N][N]) {
- for(int wiersz = 0; wiersz < N; ++wiersz) {
- wypisz_wiersz_spacji();
- wypisz_wiersz_sciany_z_przejsciem(wiersz, tablica[6][N][N]);
- ++wiersz;
- }
- }
- void wypisz_kostke(int tablica[6][N][N]) {
- up(tablica[6][N][N]);
- }
- int main(void) {
- int tablica[6][N][N];
- int kolor[6] = {0, 1, 2, 3, 4, 5};
- for(int sciana = 0; sciana < 6; ++sciana) {
- for(int wiersz = 0; wiersz < N; ++wiersz){
- for(int kolumna = 0; kolumna < N; ++kolumna){
- tablica[sciana][wiersz][kolumna] = kolor[sciana];
- }
- }
- }
- wypisz_kostke(tablica[6][N][N]);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement