Guest User

Untitled

a guest
Feb 21st, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. /* Gruppe G5 - Aufgabenblatt 7 - Aufgabe 3
  2.  
  3. Herz Andreas, Janovsky Stefan, Prinz-Zwick Andreas */
  4.  
  5. /* Laden der Bibliothek für die Bildschirmausgabe */
  6. #include <stdio.h>
  7.  
  8. /* Deklaration der Funktionen zur Prüfung ob die Reihe, Spalte oder der Block die Sudokuregeln erfüllen */
  9. bool rowSolved(int);
  10. bool colSolved(int);
  11. bool blockSolved(int);
  12. bool pruef(int);
  13.  
  14. int isSolved(int FeldBeleg [9] [9])
  15. {
  16.  
  17. bool r_p:
  18. bool r_r;
  19. bool r_c;
  20. bool r_b;
  21. r_p = pruef(FeldBeleg);
  22. r_r = rowSolved(FeldBeleg);
  23. r_c = colSolved(FeldBeleg);
  24. r_b = blockSolved(FeldBeleg);
  25.  
  26.  
  27.  
  28.  
  29. return (r_r && r_c && r_b && r_p);
  30. }
  31.  
  32.  
  33. int main()
  34. {
  35. int SudFeld [9] [9] = {{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0}};
  36. isSolved(SudFeld);
  37. return 0;
  38. }
  39.  
  40. bool rowSolved(int ReihenBeleg [9] [9])
  41. {
  42. }
  43.  
  44. bool colSolved(int SpaltenBeleg [9] [9])
  45. {
  46. }
  47.  
  48. bool blockSolved(int BlockBeleg [9] [9])
  49. {
  50. }
  51.  
  52. bool pruef(int Pruef [9] [9])
  53. {
  54. int a;
  55. int b;
  56. int pruef;
  57. /* Vollständigkeit des Sudokus prüfen */
  58. pruef = 1;
  59. for (a = 0, a < 9, a++)
  60. for (b = 0, b < 9, b++)
  61. if (Pruef[a][b]==0)
  62. {
  63. pruef = 0;
  64. }
  65. return pruef;
  66. }
Add Comment
Please, Sign In to add comment