Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 14th, 2012  |  syntax: None  |  size: 0.43 KB  |  hits: 22  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. // 9 z 237
  2. // po zmianach z zadania 10.
  3. #include <stdio.h>
  4. int main(void)
  5. {
  6. char ch;
  7.  
  8. while ((ch = getchar()) != '#')
  9. {
  10. if (ch == 'c')
  11.         printf("Krok 1\n");
  12.  
  13. if (ch != '\n' && ch != 'c')
  14. {
  15.  
  16. printf("Krok 1\n");
  17.  
  18. if (ch == 'b')
  19.         break;
  20.  
  21. if (ch == 'g')
  22.         printf("Krok 3\n");
  23. else
  24.         printf("Krok 2\n");
  25.  
  26. }
  27.  
  28. if (ch != '\n' && ch != 'c' && ch != 'g')
  29.         printf("Krok 3\n");
  30.  
  31. }
  32.  
  33.  
  34. printf("Koniec \n");
  35. return 0;
  36. }