Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.58 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4.  
  5. int main()
  6. {
  7. //1 for
  8. /*for (int a = 55; a <= 87; a++)
  9. {
  10. cout << a << endl;
  11. }*/
  12. //1 do while
  13. /*int a = 55;
  14. do
  15. {
  16. cout << a << endl;
  17. a++;
  18. }
  19. while (a <= 87);*/
  20. // 2 for
  21. /*for (int a = 0; a <= 101; a++)
  22. {
  23. cout << a << endl;
  24. a++;
  25. }*/
  26. // 2 do while
  27. /*int a;
  28. a = 0;
  29. do
  30. {
  31. cout << a << endl;
  32. a++;
  33. a++;
  34. } while (a <= 101);*/
  35. // 3 for
  36. /*for (int a = 200; 50 <= a; a--)
  37. {
  38. cout << a << endl;
  39. }*/
  40. // 3 do while
  41. /*int a;
  42. a = 200;
  43. do
  44. {
  45. cout << a << endl;
  46. a--;
  47. } while (50 <= a);*/
  48. // 4 for
  49. /*for (int a = 7; a <= 100; a++)
  50. {
  51. cout << a << endl;
  52. a++;
  53. }*/
  54. // 4 do while
  55. /*int a;
  56. a = 7;
  57. do
  58. {
  59. cout << a << endl;
  60. a++;
  61. a++;
  62. } while (a <= 100);*/
  63. //5 for
  64. /*for (int a = 0,b = 0; a <= 100; a++)
  65. {
  66. b += a;
  67. cout << b << endl;
  68. }*/
  69. // 5 do while
  70. /*int a, b;
  71. a = 0;
  72. b = 0;
  73. do
  74. {
  75. cout << b << endl;
  76. a++;
  77. b += a;
  78. } while (a <= 100);*/
  79. // 6 for
  80. /*int res,a,b,s;
  81. res = 1;
  82. s = 1;
  83. cin >> a;
  84. cin >> b;
  85. for (res = 1, s = 1; s <= b; s++)
  86. {
  87. res *= a;
  88. }
  89. cout << res << endl;*/
  90. // 6 do while
  91. /*int res, a, b, s;
  92. res = 1;
  93. s = 1;
  94. cin >> a;
  95. cin >> b;
  96. do
  97. {
  98. s++;
  99. res *= a;
  100. } while (s <= b);
  101. cout << res << endl;*/
  102. // 7 for
  103. /*for (int a = 1; a <= 9; a++)
  104. {
  105. cout << a << "*" << "7" << "=" << a * 7 << endl;
  106. }*/
  107. // 7 do while
  108. /*int a;
  109. a = 1;
  110. do
  111. {
  112. cout << a << "*" << "7" << "=" << a * 7 << endl;
  113. a++;
  114. } while (a <= 9);*/
  115. // 8 for
  116. /*long float b = 1;
  117. for (int a = 1; a <= 50; a++)
  118. {
  119. b *= a;
  120. cout << b << endl;
  121. }*/
  122. // 8 do while
  123. /*long float b = 1;
  124. int a = 1;
  125. do
  126. {
  127. b *= a;
  128. cout << b << endl;
  129. a++;
  130. } while (a <= 50);*/
  131. // 9 for
  132. /*for (int a = 1; a <= 20; a++)
  133. {
  134. cout << a << "detail count = " << a * 300 << endl;
  135. }*/
  136. // 9 do while
  137. /*int a;
  138. a = 1;
  139. do
  140. {
  141. cout << a << "detail count = " << a * 300 << endl;
  142. a++;
  143. } while (a <= 20);*/
  144. // 10 for
  145. /*int day, a = 1;
  146. cout << "Enter number day - " << endl;
  147. cin >> day;
  148. day = day % 7;
  149. for (;day > 7;day++)
  150. {
  151. day--;
  152. day = day - 7;
  153. }
  154. switch (day)
  155. {
  156. case 1:
  157. cout << "Monday" << endl;
  158. break;
  159. case 2:
  160. cout << "Tuesday" << endl;
  161. break;
  162. case 3:
  163. cout << "Wednesday" << endl;
  164. break;
  165. case 4:
  166. cout << "Thursday" << endl;
  167. break;
  168. case 5:
  169. cout << "Friday" << endl;
  170. break;
  171. case 6:
  172. cout << "Saturday" << endl;
  173. break;
  174. case 7:
  175. cout << "Sunday" << endl;
  176. break;
  177. default:
  178. cout << "Error" << endl;
  179. break;
  180.  
  181. }*/
  182. // 10 do while
  183. /*int day;
  184. cout << "Enter number day - " << endl;
  185. cin >> day;
  186. day = day % 7;
  187. if (day > 7)
  188. {
  189. do
  190. {
  191. day = day - 7;
  192. } while (day > 7);
  193. }
  194. switch (day)
  195. {
  196. case 1:
  197. cout << "Monday" << endl;
  198. break;
  199. case 2:
  200. cout << "Tuesday" << endl;
  201. break;
  202. case 3:
  203. cout << "Wednesday" << endl;
  204. break;
  205. case 4:
  206. cout << "Thursday" << endl;
  207. break;
  208. case 5:
  209. cout << "Friday" << endl;
  210. break;
  211. case 6:
  212. cout << "Saturday" << endl;
  213. break;
  214. case 7:
  215. cout << "Sunday" << endl;
  216. break;
  217. default:
  218. cout << "Error" << endl;
  219. break;
  220.  
  221. }*/
  222. //11 for
  223. /*int a,kop,grn;
  224. kop = 0;
  225. cout << "Enter money - ";
  226. cin >> a;
  227. for (grn = 0; a >= 100; grn++)
  228. {
  229. a -= 100;
  230. }
  231. kop = a % 100;
  232. cout << grn << " grn " << kop << " kop" << endl;*/
  233. //11 do while
  234. /*int a, kop, grn;
  235. grn = 0;
  236. kop = 0;
  237. cout << "Enter money - ";
  238. cin >> a;
  239. do
  240. {
  241. a -= 100;
  242. grn++;
  243. } while (a >= 100);
  244. kop = a % 100;
  245. cout << grn << " grn " << kop << " kop" << endl;*/
  246. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement