Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <conio.h>
- main()
- {
- int a,b,c,x,y;
- printf("zadaj velkost: ");
- scanf("%i",&a);
- char pole[a][a];
- for(b=0;b<a;b++)
- {
- for(c=0;c<a;c++)
- {
- if(b+c%2==0)
- {
- pole[b][c]='x';
- }
- if(b+c%2==1)
- {
- pole[b][c]='o';
- }
- }
- }
- for(x=0;x<a;x++)
- {
- for(y=0;y<a;y++)
- {
- printf("%c",pole[x][y]);
- }
- printf("\n");
- }
- getche();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement