Advertisement
Guest User

Untitled

a guest
Dec 11th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1. cout<<"Przyklad a: "<<endl;
  2. for (int i = 0; i < 15; i++)
  3. {
  4. if(i%3 == 0)
  5. cout<<"*";
  6. else if(i%3 == 1)
  7. cout<<"-";
  8. else
  9. cout<<"%";
  10. }
  11.  
  12. cout<<endl<<endl;
  13. cout<<"Przyklad b:"<<endl;
  14.  
  15. for (int i = 1; i < 5; i++)
  16. {
  17. for (int j = 0; j < i; j++)
  18. cout<<"*";
  19.  
  20. for (int k = 0; k < 2;k++ )
  21. {
  22. if(i%2 == 0)
  23. cout<<"^";
  24. else
  25. cout<<"&";
  26. }
  27. }
  28. cout<<endl<<endl;
  29.  
  30. cout<<"Przyklad d:"<<endl;
  31. for (int i = 0; i < 5; i++)
  32. {
  33. for (int j = 0; j < i; j++)
  34. {
  35. if(i%2 == 0)
  36. cout<<"%";
  37. else
  38. cout<<"$";
  39. }
  40.  
  41. cout<<"*";
  42. }
  43.  
  44. cout<<endl<<endl;
  45. cout<<"Przyklad e:"<<endl;
  46. for (int i = 0; i < 5; i++)
  47. {
  48.  
  49. for (int j = 0; j < 5; j++)
  50. {
  51. if((i*5+j) % 2==0)
  52. cout<<"* ";
  53. else
  54. cout<<"? ";
  55. }
  56.  
  57. cout<<""; cout<<endl;
  58. }
  59. cout<<endl<<endl;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement