Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2014
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <conio.h>
  4.  
  5. main()
  6. {
  7. int a,b,c,x,y;
  8. printf("zadaj velkost: ");
  9. scanf("%i",&a);
  10. char pole[a][a];
  11. for(b=0;b<a;b++)
  12. {
  13. for(c=0;c<a;c++)
  14. {
  15. if(b+c%2==0)
  16. {
  17. pole[b][c]='x';
  18. }
  19. if(b+c%2==1)
  20. {
  21. pole[b][c]='o';
  22. }
  23. }
  24. }
  25. for(x=0;x<a;x++)
  26. {
  27. for(y=0;y<a;y++)
  28. {
  29. printf("%c",pole[x][y]);
  30. }
  31. printf("\n");
  32. }
  33. getche();
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement