Advertisement
Guest User

sadasdasdads

a guest
Oct 4th, 2015
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. // ConsoleApplication1.cpp : Defines the entry point for the console application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include <stdio.h>
  6. #include <stdlib.h>
  7. int main(int argc, char *argv[])
  8. {
  9. int liczba_monet;
  10. int awers_rewers[100];
  11. int wynik =0;
  12. printf("Podaj liczbe monet\n");
  13. scanf_s("%d", &liczba_monet);
  14. for (int i = 0; i < liczba_monet; i++)
  15. {
  16. printf("podaj na jakiej stronie lezy moneta 1-awers, 0-rewers\n");
  17. scanf_s("%d", &awers_rewers[i]);
  18. }
  19. for (int i = 0; i < liczba_monet;i++)
  20. {
  21. printf("%d\t", awers_rewers[i]);
  22. printf("\n");
  23. if (awers_rewers[i] == 0)
  24. {
  25. wynik= wynik + 1;
  26. }
  27. }
  28. printf("wynik - %d ", wynik);
  29. getchar();
  30. getchar();
  31. getchar();
  32. return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement